Alan Gauld, 27.01.2012 02:16:
> with open(myfile) as aFile:
>      # use aFile

I should add that this is the shortest, safest (as in "hard to get wrong")
and most readable way to open and close a file. It's worth getting used to.

Stefan

_______________________________________________
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor

Reply via email to