Python创建文件夹
import os
def make_dir(dst_dir):
dir_sep = os.sep
if dir_sep == dst_dir[-1]:
dst_dir = dst_dir[:-1]
if dst_dir and not os.path.isdir(dst_dir):
head, tail = os.path.split(dst_dir)
make_dir(head)
os.mkdir(dst_dir, 0777)