fileio.py 299 B

1234567891011
  1. import os
  2. def walk_files(path, endpoint='.py'):
  3. file_list = []
  4. for root, dirs, files in os.walk(path):
  5. for file in files:
  6. file_path = os.path.join(root, file)
  7. if file_path.endswith(endpoint):
  8. file_list.append(file_path)
  9. return file_list