EOF

Alex Martelli alex at magenta.com
Mon Jul 10 09:22:06 EDT 2000


"fae" <fae at sis.it> wrote in message news:396623EE.211B14E9 at sis.it...
> Sorry,
>    how can I test if I reached the end of file ?

Depends on how you're reading it.  If you're reading it with
thefile.readline(), this will return a false value when, and only
when, there is nothing more to read; otherwise the returned
value (the line just read) is non-false (this is because the ending
'\n' is NOT removed, so even reading an empty-line returns
at least a '\n', which does not test as false).


Alex






More information about the Python-list mailing list