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. Using >> win32api.FindFiles(filename[:-5]+'.*par2') works perfectly, but I don't

Re: Dumb glob question

2005-02-07 Thread Michael Hoffman
Python Dunce wrote: So if I happen to be processing 'foo [bar].par2' glob.glob(filename[:-5]+'.*par2') doesn't return anything. Using win32api.FindFiles(filename[:-5]+'.*par2') works perfectly, but I don't want to rely on win32api functions. I hope that made more sense :). If you look in the

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

Re: Dumb glob question

2005-02-07 Thread [EMAIL PROTECTED]
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.index('vol', 5) -print nuke -except ValueError, e: -print e -

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