python-CSD-kursu/python-temel/os.walk.list.txt.py
2023-09-06 19:35:54 +03:00

10 lines
196 B
Python

import os
try:
f = open('list.txt', 'w')
for root, dirs, files in os.walk('/home/hwpplayer1/Documents'):
f.write(root + '\n')
f.close()
except:
print('file cannot open!')