On 07/19/2012 12:43 PM, Alex van der Spek wrote: > This beats me: > ++++++++++++++++++++ >>>> ipatterns > ('*.txt', '*.hdf', '*.pdf', '*.png') >>>> igf = shutil.ignore_patterns(ipatterns) >>>> ignorethis = igf(ddftopdir,os.listdir(ddftopdir)) > > <SNIP> > Why does it fail on passing in a tuple of ignore strings? I thought > the , (comma) is pretty much the tuple constructor (if that is the > right word). >
ignore_patterns() is not looking for a tuple, it's looking for one or more strings, as separate arguments. If you already have the tuple, you can expand it by using the asterisk, as Prasad ha pointed out. igf = shutil.ignore_patterns(*ipatterns) -- DaveA -- http://mail.python.org/mailman/listinfo/python-list