Saturday 23 May 2015

Python 3 - Opening files Using the "with" Statement

I just learnt how to save a few lines when opening files in Python 3 using the with statement.

From what I understand, the statement uses try and then opens the file, processes it and closes it. How efficient is that?



To learn more about the with statement:
http://effbot.org/zone/python-with-statement.htm

No comments:

Post a Comment