python 查找代码

code

import os
import shutil

pwd=os.getcwd()

for i in os.listdir(pwd):
    d=os.path.join(pwd,i)
    if(os.path.isdir(d)):
        for j in os.listdir(d):
            f=os.path.join(d,j)
            if("文字" in j or "python" in j.lower()):
                shutil.move(f,pwd)

 

 

 

 

 

 

 

 

 

posted @ 2020-11-03 16:24  anobscureretreat  阅读(795)  评论(0编辑  收藏  举报