我想检索单个目录中各个子文件夹中存在的所有扩展名为.xml的文件的文件名,
代码:
import os
xmlFiles = []
for directoryPath in os.walk(filePath):
fileName = directoryPath[2]
if fileName[:3] = 'xml':# or fileName.endswith('xml'):
xmlFiles.append(fileName)
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句