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

Chris Rebert clp2 at rebertia.com
Thu Mar 5 02:07:23 CET 2009


On Wed, Mar 4, 2009 at 4:46 PM, ww <mrwwli at gmail.com> wrote:
> just curious, it would make writing to a file  a bit easier?

Because we have print(), which adds the newline, and most other cases
either involve lists of stuff (so '\n'.join() is used), or the string
comes back from a library and already has newlines, so you just write
the string verbatim.

Sidenote: file.writelines() seems very misleadingly named.

Cheers,
Chris

-- 
I have a blog:
http://blog.rebertia.com



More information about the Python-list mailing list