Answers for "make a new folder inside a folder python"

14

create folder python

import os

# define the name of the directory to be created
path = "/tmp/year"

try:
    os.mkdir(path)
except OSError:
    print ("Creation of the directory %s failed" % path)
else:
    print ("Successfully created the directory %s " % path)
Posted by: Guest on April-19-2020
0

create folders in python

newpath = 'C:\Program Files\arbitrary' 
if not os.path.exists(newpath):
    os.makedirs(newpath)
Posted by: Guest on June-03-2021

Code answers related to "make a new folder inside a folder python"

Python Answers by Framework

Browse Popular Code Answers by Language