List files in directory tree

/ Published in: Python
Save to your folder(s)

Copy this code and paste it in your HTML
  1. for root,dir,files in os.walk(corpusDir):
  2. print "Listing " + root
  3. for file in files:
  4. #print os.path.abspath(os.path.join(root,file))
  5. print os.path.join(root,file)
  6. print str(len(files)) + " files found."

Report this snippet


RSS Icon Subscribe to comments

You need to login to post a comment.