python-CSD-kursu/python-temel/os.walk.list.txt.py~

10 lines
171 B
Python

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