why python doesn't have a writeline() method like c# ?

Benjamin Peterson benjamin at python.org
Wed Mar 4 20:09:16 EST 2009


ww <mrwwli <at> gmail.com> writes:

> 
> just curious, it would make writing to a file  a bit easier?

Because readline() returns the line with the newline attached, writeline() would
have to require a newline at the. Therefore, it would be equivalent to write()!

Just use f.write("some line\n").







More information about the Python-list mailing list