os.walk Value Error?

Christian Heimes lists at cheimes.de
Sat Jun 14 19:24:01 EDT 2008


tdahsu at gmail.com wrote:
> Is there any other reason I might get that error?

Yes, you are using it the wrong way. The correct way is

for root, dirs, files in os.walk(path):
    do something

os.walk returns an iterator which yields root, dirs and files for each
iteration.

Christian




More information about the Python-list mailing list