批量创建文件夹
import os path=r"D:\pylx\20210622" for i in range(20): a="202106180030253{}.file".format(i) file_name = path + "\\" + a isExists=os.path.exists(file_name) if not isExists: os.makedirs(file_name) print('%s 创建文件夹成功'%file_name) else: print('%s 文件夹名称已存在'%file_name) continue