Quantcast
Channel: How do I check whether a file exists without exceptions? - Stack Overflow
Viewing latest article 22
Browse Latest Browse All 47

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 latest article 22
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>