Tony Mack | ebaad21 | 2013-04-07 20:44:28 -0400 | [diff] [blame] | 1 | import os, fnmatch |
2 | |||||
3 | def recursive_glob(treeroot, pattern): | ||||
4 | results = [] | ||||
5 | for base, dirs, files in os.walk(treeroot): | ||||
6 | goodfiles = fnmatch.filter(files, pattern) | ||||
7 | results.extend(os.path.join(base, f) for f in goodfiles) | ||||
8 | return results |