<code>
#Python program to check if directory exists, if not, it will create a new
#Importing os module
import os
#Declare the path directory
path = 'C:/Program Files/Common Files/AV/'
# Check whether the
# specified path is an
# existing directory or not
isdir = os.path.isdir(path)
print(isdir)
#Declare a non-existing path directory
# Path
path = 'C:/Program Files/Common Files/AV/xfiles.txt'
# Check whether the
# specified path is an
# existing directory or not
isdir = os.path.isdir(path)
print(isdir)
# Create a folder if it doesn't exist
old_path = ("NewFiles")
new_path = os.path.isdir(old_path)
if not new_path:
os.makedirs(old_path)
print("Created Folder : ", old_path)
else:
print(old_path, "folder already exists.")
</code>