list to string

Fredrik Lundh fredrik at pythonware.com
Tue Feb 27 23:56:57 EST 2001


Timothy wrote:
> I'm willing to believe it - I don't use readlines(), so I was going off the
> documentation.
>
> readlines ([sizehint])
>
> Read until EOF using readline() and return a list containing the lines thus
> read. If the optional sizehint argument is present, instead of reading up
> to EOF, whole lines totalling approximately sizehint bytes (possibly after
> rounding up to an internal buffer size) are read.
>
> Doesn't mention whether the end-of-line characters are left or not.

it says it's using readline, and readline is documented as follows:

    readline ([size])

    Read one entire line from the file. A trailing newline character
    is kept in the string (but may be absent when a file ends with
    an incomplete line)

Cheers /F





More information about the Python-list mailing list