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
"[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
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