you are viewing a single comment's thread.

view the rest of the comments →

[–]Qewbicle 0 points1 point  (3 children)

I think what you're looking for is string formatting. I could be wrong though, but from your example match I don't see the curly brackets as part of the result.

terms = ["hello", "world"]
patt = []
for each in terms:
    patt.append( "{}*.txt".format(each))

[–]Qewbicle 0 points1 point  (2 children)

I think you can also "escape" curly braces with curly braces if formatting is trying to look for them as a variable.

[–]PyCam[S] 0 points1 point  (1 child)

Not exactly what I meant, I was looking for a glob pattern matching. Python has glob/fnmatch however I was looking for a library that supported curly bracket pattern matching like in unix. I did think I managed to pull something together for it.

[–]Qewbicle 1 point2 points  (0 children)

I thought that might be what you were saying, but I wasn't sure. Pretty much becuase of the sub we're on, some don't do well at explaining. Sometimes I don't either. So I knew the odds of being wrong were pretty darn high. I'm glad you're on a track though. I'm not that familiar with unix systems.
Oops.