> but I am stuck with incorrect understanding of
> os.walk. I've tried:
> 
> root, dirs, files = os.walk(dirname)

os.walk returns an iteratable sequence of those tuples.  Thus, 
you want to have

for filepath, dirs, files in os.walk(dirname):
        #you're looking at the "dirs" and "files" in filepath
        print "Currently in %s" % filepath
        print "\t[Directories in %s]" % filepath
        print "\n\t".join(dirs)
        print "\t[Files in %s]" % filepath
        print "\n\t".join(files)
        print "=" * 50

HTH,

-tkc




-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to