On Fri, 25 Mar 2011 19:39:11 -0600, Littlefield, Tyler wrote: > > with open(test_absname, 'w') as test: > what's the difference in that and test = ...? I can see why you mentioned > the os.path for cross-platform, but I don't understand why someone would > use with over =.
Using "with" will automatically close the the file upon exit from the block, whether by reaching the end of the block, return/break/continue, an exception, etc. -- http://mail.python.org/mailman/listinfo/python-list