Reading a file
Moshe Zadka
moshez at math.huji.ac.il
Wed Jul 26 01:03:14 EDT 2000
On 25 Jul 2000, Tim Northover wrote:
> I'm attempting to read a file line by line with readline(), but it
> seems to return and empty string when EOF is encountered. Is there a
> way of discerning the difference between the end of the file and a
> blank line in the file?
Yes. A blank line is '\n', not ''
--
Moshe Zadka <moshez at math.huji.ac.il>
There is no IGLU cabal.
http://advogato.org/person/moshez
More information about the Python-list
mailing list