How do I return path to file if it exists in python
This question already has an answer here:
Invoke os.stat(filename)
where filename can be a file or directory path. If the file exists, it will return a valid stat object. Otherwise, it throws a FileNotFound exception.