Posted By

fnurl on 04/05/09


Tagged

FileSystem


Versions (?)

Who likes this?

1 person have marked this snippet as a favorite

danielalexwood


Check if file exists


 / Published in: Python
 

  1. try:
  2. file = open("testfile", 'r')
  3. print "File exists."
  4. file.close()
  5. except IOError:
  6. print "File does not exist."

Report this snippet  

You need to login to post a comment.