Steven Bethard <[EMAIL PROTECTED]> wrote:
> at the OP's original code, the line:
>
> [(x[0], x[2]) for x in os.walk(".")]
>
> is the equivalent of:
>
> [dirpath, filenames for dirpath, dirnames, filenames in os.walk('.')]
Just a nit: you need parentheses in your second LC too, i.e.:
[(dirpath, filenames) for dirpath, dirnames, filenames in os.walk('.')]
> I prefer to give names to the values produced by os.walk -- I think it
> makes the usage much clearer.
Full agreement here -- those numeric indices are nasty.
Alex
--
http://mail.python.org/mailman/listinfo/python-list