Skip to content

Instantly share code, notes, and snippets.

@trigfa
Created September 27, 2013 11:09
Show Gist options
  • Save trigfa/6727075 to your computer and use it in GitHub Desktop.
Save trigfa/6727075 to your computer and use it in GitHub Desktop.
Check if a filename exist in python
try:
with open('filename'): pass
except IOError:
print 'Oh dear.'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment