Stripping new lines from strings?
Bill Spears
bspears at mail.teleport.com
Wed Aug 23 13:44:55 EDT 2000
CHRIS wrote:
> ajung at suxers.de wrote:
>
>
>
> From what I understand of Python file I/O, there is no guarantee that
> returned lines all contain new lines characters so, it may clip the last
> line's ending character. And even then, if it is used on a Windows file,
> it would skip the '\r' character.
>
Are you sure about this? I thought the idea of reading a line is that you
got a line, i.e. it has \n on the end. And I believe that the conversion
from file \r\n to \n is supposed to be automatic. I guess maybe the last
line in the file could be missing an end of line marker.
More information about the Python-list
mailing list