<s>[INST] How do I check whether a file exists using Python? How do I check whether a file exists, without using the try statement?
 [/INST] You can also use os.path.isfile

Return True if path is an existing regular file. This follows symbolic links, so both islink() and isfile() can be true for the same path.

import os.path
os.path.isfile(fname) 

if you need to be sure it's a file.
Starting with Python 3.4, the pathlib module offers an object-oriented approach:
from pathlib import Path

my_file = Path("/path/to/file")
if my_file.is_file():
    # file exists

 </s>