def findFile(p, kw):
files = [x for x in os.listdir(p) if os.path.isfile(os.path.join(p, x)) and os.path.splitext(x)[1]==kw]
for f in files:
print('[p]', p, '\t[f]', f)
dirs = [x for x in os.listdir(p) if os.path.isdir(os.path.join(p, x))]
for d in dirs:
d = os.path.join(p, d)
findFile(d, kw)
return
findFile('.', '.py')
Airest1998