Filename Filter
ただ単にfnmatchを使いたかっただけ。
import fnmatch import os import os.path ignore_files = ['*/.svn/*', '*/CVS/*', '*.pyc'] for root, dirs , files in os.walk('.'): for file in files: path = os.path.join(root, file) ignore = reduce(lambda x, y: x or y, [fnmatch.fnmatch(path, i) for i in ignore_files]) if not ignore : print path
pythonのglobも**サポートしてくんねえかなあ。。。