import os
def finder(pattern, root='.'):
matches = []
dirs = []
for x in os.listdir(root):
if os.path.isdir(os.path.join(root, x)):
dirs.append(x)
elif os.path.isfile(os.path.join(root, x)) and pattern in x:
matches.append(x)
for match in matches:
print(os.path.join(root, match))
for dir in dirs:
finder(pattern, root=os.path.join(root, dir))
米粽粽