Discuss / Python / 终于搞定,没有使用os.walk 。给大家参考

终于搞定,没有使用os.walk 。给大家参考

Topic source

不会潘岩

#1 Created at ... [Delete] [Delete and Lock User]

import os def find_files(name,rootDir): for list in os.listdir(rootDir): path = os.path.join(rootDir,list) if os.path.isfile(path) and name in list: print(path) if os.path.isdir(path): find_files(name,path)


  • 1

Reply