Skip to main content

All Questions

2 votes
4 answers
2k views

File exists vs. File does not exist. Is there a difference in performance?

Let's say I am checking a directory for the existence of a file, and then depending on whether or not the file exists, I act accordingly. For example, see the two Python snippets below. if os.path....
Dryden Long's user avatar