Advertisement
Guest User

Left_right

a guest
Feb 24th, 2018
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.32 KB | None | 0 0
  1. def getLeftRight(startpath):
  2. node = 1
  3. rht = 1
  4. lft = 1
  5.  
  6. for root, dirs, files in os.walk(startpath):
  7. level = root.replace(startpath, '').count(os.sep)
  8. indent = ' ' * 4 * (level)
  9. print(indent , dirs , lft , rht)
  10.  
  11. subindent = ' ' * 4 * (level + 1)
  12. for f in files:
  13. print(subindent , f , lft , rht)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement