daily pastebin goal
25%
SHARE
TWEET

Left_right

a guest Feb 24th, 2018 71 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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)
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top