import os
def search(text,path ='.'):
for name in os.listdir():
current = os.path.join(path,name)#递归得以实现的关键
if os.path.isdir(name):
search(text,current)
elif name.find(text)!= -1:
print(current)
if __name__ == '__main__':
text = input('Please input')
search(text)
09-14
16万+
![](https://csdnimg.cn/release/blogv2/dist/pc/img/readCountWhite.png)