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

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

$
0
0

To check if a file exists,

from sys import argvfrom os.path import existsscript, filename = argvtarget = open(filename)print "file exists: %r" % exists(filename)

Viewing all articles
Browse latest Browse all 47

Trending Articles



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