[Tutor] is there an explicit eof to test in Py 3?

Jim Mooney cybervigilante at gmail.com
Mon Apr 22 03:35:00 CEST 2013


  I'm reading a book that suggests finding EOF when the readLine == ""

 But wouldn't that end erroneously on blank lines, that really contain
'\n', in which case more lines might follow? What 'empties' are
considered equal in Python? I'm coming from javascript which has a
cluster of rules for that.

Yes, I know the easy way is a for loop, which automatically breaks on
eof, but at times I want to use a while loop and break out of it
explicitly on eof. But I can't seem to find an explicit eof marker in
python. Is there one?

--
Jim Mooney

Today is the day that would have been tomorrow if yesterday was today


More information about the Tutor mailing list