Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Test Thread
#1
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')
snippsat write Apr-12-2023, 04:42 AM:
Added code tag in your post
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Test post of Thread as user Xenex_ultra122 Xenex_ultra122 0 1,879 Dec-04-2022, 02:53 PM
Last Post: Xenex_ultra122
  Just Practicing Posting. Test Thread. “Sandbox” Thread. No Reply needed, Thanks Doc_AElstein 4 6,549 Dec-21-2017, 08:55 PM
Last Post: micseydel

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020