This is what I have:
glob(os.path.join(\'src\',\'*.c\'))
but I want to search the subfolders of src. Something like this would work:
Simplified version of Johan Dahlin's answer, without fnmatch.
import os matches = [] for root, dirnames, filenames in os.walk('src'): matches += [os.path.join(root, f) for f in filenames if f[-2:] == '.c']