python create directories for file if not exists code example
Example: python make directory if not exists
try:
os.makedirs("path/to/directory")
except FileExistsError:
# directory already exists
pass
try:
os.makedirs("path/to/directory")
except FileExistsError:
# directory already exists
pass