stdio EOF ?

François Pinard pinard at iro.umontreal.ca
Fri Aug 9 23:06:19 CEST 2002


[Erik Max Francis]

> The standard idiom [...] is:

> 	while 1:
> 	   line = file.readline()
> 	   if not line:
> 	      break
> 	   ...

This is the _old_ standard idiom.  The new standard idiom is:

    for line in file:
        ...

-- 
François Pinard   http://www.iro.umontreal.ca/~pinard





More information about the Python-list mailing list