> f = open("myfile.txt")
> for line in f:
>   print line
> f.close()   # This is what the "with" statement guarantees; so now just do
> it yourself

Not exactly. More like:

f = open("myfile.txt")
try:
    for line in f:
        print line
finally:
    f.close()


Daniel
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to