You have the os.path.exists
function:
import os.pathos.path.exists(file_path)
This returns True
for both files and directories but you can instead use
os.path.isfile(file_path)
to test if it's a file specifically. It follows symlinks.
You have the os.path.exists
function:
import os.pathos.path.exists(file_path)
This returns True
for both files and directories but you can instead use
os.path.isfile(file_path)
to test if it's a file specifically. It follows symlinks.