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

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

$
0
0

You can use the "OS" library of Python:

>>> import os>>> os.path.exists("C:\\Users\\####\\Desktop\\test.txt") True>>> os.path.exists("C:\\Users\\####\\Desktop\\test.tx")False

Viewing all articles
Browse latest Browse all 46

Trending Articles



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