Quoth Tim Chase <python.l...@tim.thechases.com>:
> rdmur...@bitdance.com wrote:
> > What you want is:
> > 
> >     from fnmatch import fnmatch
> 
> Oh, that's head-smackingly obvious now...thanks!
> 
> My thought process usually goes something like
> 
> """
> I want to do some file-name globbing
> 
> there's a glob module that looks like a good place to start
> 
> hmm, dir(glob) tells me there's a fnmatch thing that looks like 
> what I want according to help(glob.fnmatch)
> 
> oh, the fnmatch() function is inside this glob.fnmatch thing
> 
> so, I want glob.fnmatch.fnmatch()
> """
> 
> It never occurred to me that fnmatch was its own importable 
> module.  <sheepish grin>

I did a help(glob), saw that fnmatch wasn't in there, did a dir(glob),
saw fnmatch and was puzzled, so I looked up the glob doc page on
docs.python.org for glob.  There was a cross reference at the bottom
of the page to fnmatch, and it was only at that point that I went:
"oh, duh" :)

--RDM

--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to