Pythonic way to check if a file exists? [duplicate]

To check if a path is an existing file:

os.path.isfile(path)

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.

Leave a Comment