I have tried many things on the internet but can't find a simple code to create a folder through python on MAC.
Asked
Active
Viewed 1,208 times
-4
-
does that post help: https://stackoverflow.com/questions/11700593/creating-files-and-directories-via-python – papanito Sep 21 '21 at 14:22
1 Answers
0
import os
# define the name of the directory to be created
path = "/tmp/om"
try:
os.mkdir(path)
except OSError:
print ("Creation of the directory %s failed" % path)
else:
print ("Successfully created the directory %s " % path)

Milan_sir7
- 17
- 3