python 遍历文件夹

一. 用递归遍历目录 # 定义一个函数来遍历目录 import os def getAllDirAndFile(pathDir): # 判断是不是目录 if not os.path.isdir(pathDir): return listNames = os.listdir(pathDir) for name in listNames:
相关文章
相关标签/搜索