eof?

Cris A. Fugate fugate at lucent.com
Tue Aug 14 16:42:04 EDT 2001


Can't find a convenient way to check for the end of an input file.
I would like to say something like this where fh.eof would return
a boolean value for the eof condition. How is this done, or is
there another way? TIA

fh = open("file", "r")
while (not fh.eof):
   fh.readline()

**********************************************************************
Cris A. Fugate          Lucent Technologies, Robust Process Automation
fugate at lucent.com       http://ihgpweb.ih.lucent.com/~fugate
630 713-8255            Sponsor of the lucent.lang.tcl newsgroup





More information about the Python-list mailing list