Quantcast
Channel: How do I check whether a file exists without exceptions? - Stack Overflow
Viewing all articles
Browse latest Browse all 47

Answer by user2154354 for How do I check whether a file exists without exceptions?

$
0
0

You should definitely use this one.

from os.path import existsif exists("file") == True:    print "File exists."elif exists("file") == False:    print "File doesn't exist."

Viewing all articles
Browse latest Browse all 47

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>