os.walk() dirs and files

rtilley rtilley at vt.edu
Wed Feb 8 08:53:38 EST 2006


Duncan Booth wrote:

> How about just concatentating the two lists:
> 
>>for root, dirs, files in os.walk(path):
>        for fs_object in files + dirs:
>>         ADD fs_object to dictionary

Thank you Duncan! that solves the problem perfectly!



More information about the Python-list mailing list