第二题 。
Topic sourceimport os
path= input('输入查询路径:')
xun=input('请输入要查询的文件包含的字符串:')
def finpath(path):
for x in os.listdir(path):
mypath=os.path.abspath(os.path.join(path,x))
if os.path.isfile(mypath):
if mypath.find(xun) != -1:
print('找到文件',x)
print('路径',mypath)
else:
finpath(mypath)
finpath(path)
- 1
真诚的刘海柱