On 2021-07-13 at 14:11:15 -0000,
[email protected] 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()
_______________________________________________
Python-ideas mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3/lists/python-ideas.python.org/
Message archived at
https://mail.python.org/archives/list/[email protected]/message/PZVKOJSCDQSCSKGFYU2AX7KAWLZ373LC/
Code of Conduct: http://python.org/psf/codeofconduct/