python遍历文件夹下的所有文件
# 遍历文件夹下的所有文件 import os def readDictionary(dictoryName): for filename in os.listdir(dictoryName): filepath = os.path.join(dictoryName, filename) if os.path.isdir(filepath): readDictionary(filepath) else: print(filepath) if __name__=="__main__": dictionaryName = "C:\\Users\\Administrator\\Desktop\\resources" readDictionary(dictionaryName)