Posted By


fnurl on 04/05/09

Tagged


Statistics


Viewed 795 times
Favorited by 0 user(s)

Check if file exists


/ Published in: Python
Save to your folder(s)



Copy this code and paste it in your HTML
  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


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.