[Tutor] glob module

Isr Gish isrgish at fusemail.com
Thu Feb 5 00:15:40 EST 2004



-----Original Message-----
   >From: "Gerrit"<gerrit at nl.linux.org>
   >Sent: 2/4/04 11:30:08 AM
   >To: "Isr Gish"<isrgish at fusemail.com>
   >Cc: "tutor at python.org"<tutor at python.org>
   >Subject: Re: [Tutor] glob module
     >Isr Gish wrote:
   >> Docs
   >>     recipes
   >>         new
   >>         old
   >>     help
   >>         all
   >> ...
   >> I want to find all files with "a*.txt" from whole tree of Docs how would I do that. I understand that I could iterate the whole tree. But what I would like to know, if it can be done, with the glob module.
   >
   >If it's always 3 levels deep, you can use '*/*/a*.txt'.
   >That makes using os.walk unnecesary.

Thanks Gerrit,

This was only an example in realty I want to get files from all levels.

I guess I'll have to do a walk.

Isr




More information about the Tutor mailing list