Glob in python which supports the ** wildcard

Simon Brunning simon at brunningonline.net
Tue Nov 23 04:08:59 EST 2010


On 22 November 2010 21:43, Martin Lundberg <martin.lundberg at gmail.com> wrote:
> Hi,
>
> I want to be able to let the user enter paths like this:
>
> apps/name/**/*.js
>
> and then find all the matching files in apps/name and all its
> subdirectories. However I found out that Python's glob function
> doesn't support the recursive ** wildcard. Is there any 3rd party glob
> function which do support **?

This does roughly what you want:

http://code.activestate.com/recipes/499305-locating-files-throughout-a-directory-tree/

-- 
Cheers,
Simon B.



More information about the Python-list mailing list