Advertisement
Guest User

Untitled

a guest
May 27th, 2018
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.42 KB | None | 0 0
  1. import os
  2. from os import listdir
  3. import os
  4.  
  5. def list_files(startpath):
  6. for root, dirs, files in os.walk(startpath):
  7. level = root.replace(startpath, '').count(os.sep)
  8. indent = ' ' * 4 * (level)
  9. print('{}{}/'.format(indent, os.path.basename(root)))
  10. subindent = ' ' * 4 * (level + 1)
  11. for f in files:
  12. print('{}{}'.format(subindent, f))
  13. list_files("school9.perm.ru")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement