I want to create folder name 1 in folder abc. This is the code.
id=input("enter user id : ")
path = "/abc/" + str(id)
try:
os.mkdir(path)
except OSError:
print ("Creation of the directory %s failed" % path)
else:
print ("Successfully created the directory %s " % path)
I enter 1 for create folder name 1 but it show error like this. How to fix it?
enter user id : 1
Creation of the directory /abc/1 failed
OSErrorexception is raised - look at the exception and see what message or error code comes with it.