On 2021-07-13 at 14:11:15 -0000,
sandhoners...@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()

_______________________________________________
Python-ideas mailing list -- python-ideas@python.org
To unsubscribe send an email to python-ideas-le...@python.org
https://mail.python.org/mailman3/lists/python-ideas.python.org/
Message archived at 
https://mail.python.org/archives/list/python-ideas@python.org/message/PZVKOJSCDQSCSKGFYU2AX7KAWLZ373LC/
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to