批量创建文件夹
# coding=gbk # -*- coding: utf-8 -*- import os, sys def mkdir(basepath): path = os.path.join(basepath) if os.path.exists(path): print('文件已存在') else: os.mkdir(path) def mkdir2(basepath, paramslist): for param in paramslist: path = os.path.join(basepath + param) if os.path.exists(path): print('文件已存在') else: os.mkdir(path) if __name__ == '__main__': basepath = r'/Users/zhangjingjing/Documents/需求/8人行平台/标准版/PCR/project/tools/苏银凯基/' param = 'A' # mkdir(basepath) # paramslist1 = ["administrative_penalty_records", # "Loan_Latest6Countstate", # "Loan_Latest6Max_Duration", # "loan_pf_herf" # ] paramslist=[ "pboc_bs61_090", "pboc_bs61_091" ] mkdir2(basepath, paramslist)