[Tutor] glob.glob(pattern, dir) ?

Sander Sweers sander.sweers at gmail.com
Tue Jun 9 20:50:35 CEST 2009


On Tue, 2009-06-09 at 20:23 +0200, spir wrote:
> Le Tue, 9 Jun 2009 17:40:26 +0200,
> Sander Sweers <sander.sweers at gmail.com> s'exprima ainsi:
> > 2009/6/9 spir <denis.spir at free.fr>:
> > > is there a way to make glob work in a specified dir?
> > 
> > >>> import glob
> > >>> glob.glob('c:\\GTK\\*.txt')

<snip>

> Thank you. That was so simple I couldn't figure it out myself ;-)

OK, sorry I misunderstood the question.

> What I was expecting is:
> 
> (used e.g.
>    print dirglob("/home/spir/prog/*/doc", "*.txt")
> to get .txt files from only doc subdirs of all projects)

This time you explained it way better then before ;-)

Greets
Sander



More information about the Tutor mailing list