Problem while reading a text file in reverse order.

Greg Krohn gkrohn at tcq.net
Wed May 1 05:54:43 EDT 2002


[snip]

> Is there a way to enable '\r' for read() method on Windows, or to code
> it intelligently :-) to handle it. (by means of either completely not
> caring about line feeds, or accounting '\r')

Very easy to fix. Open the file in binary mode:

f = open(myfile, 'rb')





More information about the Python-list mailing list