# Python program to explain os.path.exists() method
# importing os module
import os
# Specify path
path = '/usr/local/bin/'
# Check whether the specified
# path exists or not
isExist = os.path.exists(path)
print(isExist)
# Specify path
path = '/home/User/Desktop/file.txt'
# Check whether the specified
# path exists or not
isExist = os.path.exists(path)
print(isExist)
# credit to geeksforgeeks.com at
# https://www.geeksforgeeks.org/python-check-if-a-file-or-directory-exists/
# plz suscribe to my youtube channel -->
# https://www.youtube.com/channel/UC-sfqidn2fKZslHWnm5qe-A
import os
filename = "creating file with python function"#your file name
print("Do ",filename," exists:- ",os.path.exists(filename))