On Sunday 11 October 2009 11:56:55 pm Dennis Lee Bieber wrote:
> In this situation, the middle exit works best -- using
> non-optimal Python
>
> while True:
> lin = file_object.readline()
> if not lin: break
> do something with lin
Actually, in python, this works even better:
for lin in iter(file_object.readline, ""):
... do something with lin
--
Luis Zarrabeitia (aka Kyrie)
Fac. de Matemática y Computación, UH.
http://profesores.matcom.uh.cu/~kyrie
--
http://mail.python.org/mailman/listinfo/python-list