Re: Dumb glob question

2005-02-08 Thread Python Dunce
Michael Hoffman <[EMAIL PROTECTED]> wrote in comp.lang.python: > Python Dunce wrote: > >> So if I happen >> to be processing 'foo [bar].par2' >> >> glob.glob(filename[:-5]+'.*par2') >> >> doesn't return anything. U

Re: Dumb glob question

2005-02-07 Thread Python Dunce
"[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote in comp.lang.python: > code like below willprint all files ending on 'par2', except tose not > containong 'vol' from the 5th position. is that what you need? > -import glob > -for nuke in glob.glob(r"""c:\temp\*.par2"""): > -try: > -nuke.in

Dumb glob question

2005-02-06 Thread Python Dunce
I've run into an issue with glob and matching filenames with brackets '[]' in them. The problem comes when I'm using part of such a filename as the path I'm passing to glob. Here's a trimmed down dumb example. Let's say I have a directory with the following files in it. foo.par2 foo.vol0+1.p