xxxxxxxxxx
os.path.exists(path_to_file)
Code language: CSS (css)
xxxxxxxxxx
# importing os module
import os
# Specify path
path = '/usr/local/bin/'
# Check if the path exists
isExist = os.path.exists(path)
print(isExist)
OUTPUT:
True #if path exist
False #if path doesn't exist