import os
search_path= "c:\\"
search_file = "password.txt"
result = []
for dirpath, subdirs, files in os.walk(search_path):
for x in files:
if x == search_file:
result .append(os.path.join(dirpath, x))
print result
Алексей Ярков: def a(search_path,search_file):
import os
result=[]
for dirpath, subdirs, files in os.walk(search_path):
for x in files:
if x == search_file:
result .append(os.path.join(dirpath, x))
print (result)