George Sakkis wrote:

> Or a bit more efficiently (no need to allocate a new list for storing
> files+dirs):
> 
> from itertools import chain
> for root, dirs, files in os.walk(path):
>       for fs_object in chain(files,dirs):
>               ADD fs_object to dictionary

I like that! itertools is cool... a bit abstract and computer sciencey, 
but it sure does work in a practical manner :)
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to