I would like to come up with the most optimal way of listing all files in a directory and its subdirectories. Once done, I would like to filter them down. So, optimally this would be done in 2 lines:
def getFilesContaining(filename):
files = map(lambda x: os.path.join(x, file), os.walk('.')) #Note: this map does NOT work
filtered_files = filter(lambda x: filename in x, files)
return filtered_files