python 判断文件夹存在,不存在创建文件夹

 

判断文件文件夹是否存在

'''
    判断文件是否存在,存在无效果,不存在则生成文件夹
    path:路径的绝对路径,通过获取当前文件的绝对路径,再将文件夹文件拼接起来
'''
def isexists_dir_Create(self,path):
     if not os.path.exists(path):
        os.makedirs(path)

 

posted @ 2019-08-26 16:13    阅读(2982)  评论(0编辑  收藏  举报