A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from http://mail.python.org/pipermail/python-dev/1999-July/000531.html below:

[Python-Dev] End of the line

[Python-Dev] End of the lineTim Peters tim_one@email.msn.com
Wed, 14 Jul 1999 11:42:14 -0400
[Tim]
> On reading, libc usually takes care of what's needed, and what
> remains is to check for stray '\r' characters that stdio glossed over.

[Jack Jansen]
> This'll work for Unix and PC conventions, but not for the Mac.
> Mac end of line is \r, so reading a line from a mac file on unix will
> give you the whole file.

I don't see how.  Did you look at the code I posted?  It treats '\r' the
same as '\n', except that when it sees an '\r' it eats a following '\n' (if
any) too, and replaces the '\r' with '\n' regardless.

Maybe you're missing that Python reads lines one character at a time?  So
e.g. the behavior of the platform libc fgets is irrelevant.





RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4