[SciPy-User] Curse of recursive directory walking

Gökhan Sever gokhansever at gmail.com
Thu Jul 30 15:39:04 EDT 2009


On Thu, Jul 30, 2009 at 8:04 AM, <josef.pktd at gmail.com> wrote:

>
> something like this might work.
>
> >>> for r,d,f in os.walk(r'C:\path\of\directory'):
>        d.sort()
>        d.reverse()
>        print r
>
> this gives me walking the tree in reverse, python-alphabetical order
> (capital letters first)
>
> Josef
>

d.sort() did the trick.

Thanks for your help. Now it behaves as I wanted it to work.


-- 
Gökhan
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.scipy.org/pipermail/scipy-user/attachments/20090730/97d2f8ef/attachment.html>


More information about the SciPy-User mailing list