Quantcast
Viewing latest article 22
Browse Latest Browse All 47

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

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

Trending Articles