python看是否存在某个文件,如果不存在,则新建一个这样的文件

import os
if not os.path.exists('foldername'):
    os.mkdirs('foldername')

猜你喜欢

转载自blog.csdn.net/zhuoyuezai/article/details/83822663