correct way to catch exception with Python 'with' statement

woooee at gmail.com woooee at gmail.com
Tue Nov 29 18:59:59 EST 2016


If you want to do something only if the file exists (or does not), use os.path.isfile(filename)



More information about the Python-list mailing list