import os
def findFileWithStr(path,s):
for root,dirs,files in os.walk(path):
for file in files:
if s in file:
# lstrip方法未能返回正确结果
# print(os.path.join(root,file).lstrip(path))
relativePath=os.path.join(root,file).replace(path,'')
print('/'+relativePath if relativePath[0]!='/' else relativePath)
ChaselZ0429