Python Forum

Full Version: Test Thread
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
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')