(folder_path, txt_path)
| 1 | import os |
| 2 | |
| 3 | def write_png_paths(folder_path, txt_path): |
| 4 | with open(txt_path, 'w') as f: |
| 5 | for root, dirs, files in os.walk(folder_path): |
| 6 | for file in files: |
| 7 | if file.endswith('.png'): |
| 8 | f.write(os.path.join(root, file) + '\n') |
| 9 | |
| 10 | # Example usage: |
| 11 | folder_path = '' |