eof?

Chris Barker chrishbarker at home.net
Wed Aug 15 14:24:38 EDT 2001


Peter Hansen wrote:

> > fh = open("file", "r")
> > line = fh.readline()
> > while 1:
> >     # do stuff with line
> >     # there could be a LOT of code here
> >
> >     line = fh.readline()
> 
> Definitely better than what you used to do, since your code
> wouldn't exit.  Or was that the point? :)

OOPS. never post code you havn't tested!!! that should be:

while line:  # of course


-Chris

-- 
Christopher Barker,
Ph.D.                                                           
ChrisHBarker at home.net                 ---           ---           ---
http://members.home.net/barkerlohmann ---@@       -----@@       -----@@
                                   ------@@@     ------@@@     ------@@@
Oil Spill Modeling                ------   @    ------   @   ------   @
Water Resources Engineering       -------      ---------     --------    
Coastal and Fluvial Hydrodynamics --------------------------------------
------------------------------------------------------------------------



More information about the Python-list mailing list