def go(cur):
for dr in os.listdir(cur):
abs_path = os.path.join(cur, dr)
if os.path.isdir(abs_path):
go(abs_path)
else:
if '.doc' in abs_path:
continue
yield abs_path
for file in go(path):
print(file)