[Python] python自定义文件查找函数 →→→→→进入此内容的聊天室

来自 , 2020-10-25, 写在 Python, 查看 129 次.
URL http://www.code666.cn/view/ac71e007
  1. import os
  2. import thread
  3. from fnmatch import fnmatch
  4.  
  5. def finds(startpath,files):
  6.     try:
  7.         for i in os.listdir(startpath):
  8.             if fnmatch(i,files) == True:
  9.                 print os.path.join(startpath,i)
  10.             elif os.path.isdir(os.path.join(startpath,i)) == True:
  11.                 thread.start_new_thread(finds, (os.path.join(startpath,i),files))
  12.             else:
  13.                 pass
  14.     except:
  15.         pass
  16. #//python/8452

回复 "python自定义文件查找函数"

这儿你可以回复上面这条便签

captcha