for root, dirs, files in os.walk('/tmp'): if os.path.basename(root) != 'modules': continue data = [parse_file(os.path.join(root,f)) for f in files]