How to create a directory if it does not exist in Python

1 Answer

0 votes
import os

directory = "d:\\test_directory"

if not os.path.exists(directory):
    os.makedirs(directory)


'''
run:


'''

 



answered Mar 8, 2018 by avibootz
...