Python Forum
Test Thread - Printable Version

+- Python Forum (https://python-forum.io)
+-- Forum: Forum & Off Topic (https://python-forum.io/forum-23.html)
+--- Forum: Board (https://python-forum.io/forum-26.html)
+--- Thread: Test Thread (/thread-39768.html)



Test Thread - snippsat - Apr-12-2023

from pathlib import Path
from os import fspath

dest = r'C:\bar'
with open('out1.txt', 'w') as f:
    for path in Path(dest).rglob('*'):
        if path.is_file():
            print(path)
            f.write(f'{fspath(path)}\n')