/ Published in: Python

I always forget this.
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
import os import sys fileList = [] rootdir = sys.argv[1] for root, subFolders, files in os.walk(rootdir): for file in files: fileList.append(os.path.join(root,file)) print fileList
URL: http://mayankjohri.wordpress.com/2008/07/02/create-list-of-files-in-a-dir-tree/
Comments
