13 Jul
2021
13 Jul
'21
3:40 p.m.
On 2021-07-13 at 14:11:15 -0000, sandhoners123@gmail.com wrote:
Maybe (to be consistent with other functions like print), end= since that would allow even custom line endings
As it stands, writelines is consistent with readlines. Both preserve newlines. All else being equal, the following copies a file: input_file = open(input_pathname, 'r') output_file = open(output_pathname, 'w') lines = input_file.readlines() output_file.writelines(lines) input_file.close() output_file.close()