Python新建文件夹(如果不存在)

import os
if not os.path.exists(directory):
    os.mkdir(directory)