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
(visto en http://mayankjohri.wordpress.com/2008/07/02/create-list-of-files-in-a-dir-tree/)
Funciona de maravillas
Suscribirse a:
Enviar comentarios (Atom)
No hay comentarios:
Publicar un comentario