regular expression concatenation with strings
sc0rp at hot.pl
Fri Jun 22 23:30:31 CEST 2007
> I noticed a small error in the code (you referenced extension, which
> you had renamed to filenameRx), and when I corrected it I received the
> original error again.
I haven't had PIL installed, so I just commented out im.* calls for
test. Just change:
im.save(file + ".thumbnail." + extension)
im.save(file + ".thumbnail" + ext)
> What was it you were trying to do to solve the
> problem, though?
You can't use glob with regexps. Instead use os.listdir() to get
filenames and then rx.match() to find ones that does match the pattern.
More information about the Python-list