Python Success Stories or Nightmares
Richard Jones
rjones at ekit-inc.com
Thu Jan 30 18:51:59 EST 2003
On Fri, 31 Jan 2003 10:42 am, Grzegorz Adam Hankiewicz wrote:
> On Thu, Jan 30, 2003 at 05:49:54PM -0500, Mongryong wrote:
> > What works and doesn't work in Python.
>
> while (line = file.readline()):
>
> I still miss that one-liner.
This has worked for a very long time:
for line in file.readlines():
or, in the more recent versions of python:
for line in file:
Richard
More information about the Python-list
mailing list