python看是否存在某个文件,如果不存在,则新建一个这样的文件 import os if not os.path.exists('foldername'): os.mkdirs('foldername')