Graceful handling of first line
__peter__ at web.de
Sat Oct 9 08:17:14 CEST 2004
Steven Bethard wrote:
> There's still a NameError to catch if you haven't initialized line:
>>>> for line in :
> ... break
> Traceback (most recent call last):
> File "<stdin>", line 1, in ?
> NameError: name 'line' is not defined
No, you would put code specific to the first line into the loop before the
> I don't much like the break out of a for loop, because it feels like a
I can understand that.
More information about the Python-list