【发布时间】:2021-09-21 14:20:31
【问题描述】:
我在互联网上尝试了很多东西,但找不到一个简单的代码来通过 MAC 上的 python 创建文件夹。
【问题讨论】:
我在互联网上尝试了很多东西,但找不到一个简单的代码来通过 MAC 上的 python 创建文件夹。
【问题讨论】:
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)
【讨论】: