1.目录操作 import os os.mkdir('abc') #创建abc文件 tree a #查看目录结构 2.目录遍历 方式一:递归 import os def dirList(path): filelist=os.listdir(path) for filename in filelist: filepath=os.path.join(path,filename) if os.path.isdir(filepath): dirList(filepath) print filepa…
def deleteDirectory(self,current_path): if not os.path.exists(current_path): self.logger.info(current_path + "does not exist, go on") return assert os.path.isdir(current_path), current_path + " is not directory" current_filelist = os.l…