1# This requires Python’s OS module
2import os
3
4# 'mkdir' creates a directory in current directory.
5os.mkdir('tempDir')
6# can also be used with a path, if the other folders exist.
7os.mkdir('tempDir2/temp2/temp')
8
9# 'makedirs' creates a directory with it's path, if applicable.
10os.makedirs('tempDir2/temp2/temp')
1import os
2directory = "Krishna"
3path_dir = "C:/Users/../Desktop/current_dir/"
4if not os.path.exists(directory):
5 os.mkdir(os.path.join(path_dir, directory))