os.walk() usage

rbt rbt at athop1.ath.vt.edu
Tue Feb 15 16:39:04 EST 2005


wittempj at hotmail.com wrote:
> every object in os.walk() returns a 3-tuple, like below, it seems your
> code assumes it returns only a list of files.
> 
> for d in os.walk('c:\\temp'):
> 	(dirpath, dirnames, filenames) = d
> 	print dirpath
> 	print dirnames
> 	print filenames
> 

Thank you, this fixed it. I didn't read the docs well enough ;)



More information about the Python-list mailing list