Advertisement
here2share

# TreeList.py -- list all in directory and subdirectories

Dec 8th, 2015
211
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.34 KB | None | 0 0
  1. # TreeList.py -- list all in directory and subdirectories
  2.  
  3. import os
  4.  
  5. path='C:\Program Files\Windows Media Player'
  6.  
  7. for root, dirs, files in os.walk( path ):
  8.     for name in dirs:
  9.         print(os.path.join(root, name))
  10. print
  11. print
  12. for root, dirs, files in os.walk( path ):
  13.     for name in files:
  14.         print(os.path.join(root, name))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement