python自定义文件查找函数,需要给定要查找的路径和文件名列表
import os import thread from fnmatch import fnmatch def finds(startpath,files): try: for i in os.listdir(startpath): if fnmatch(i,files) == True: print os.path.join(startpath,i) elif os.path.isdir(os.path.join(startpath,i)) == True: thread.start_new_thread(finds, (os.path.join(startpath,i),files)) else: pass except: pass