How do I check if a file exists or not, without using the try statement?
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