You can use:
import os.path
os.path.isfile(fname)
if you need to be sure it's a file.
\r\nHow do I check if a file exists, using Python, without using a try statement?\r\n\r\n
You can use:
import os.path
os.path.isfile(fname)
if you need to be sure it's a file.
\r\nFileNotFoundError
exception in Python-3.