def recursive_filelisting(base_directories):
 for base_directory in base_directories:
  for (root, _, files) in os.walk(base_directory):
   for leaffile in files:
    (yield os.path.join(root, leaffile))

def recursive_filelisting ( base_directories ) : for base_directory in base_directories : for ( root , _ , files ) in os . walk ( base_directory ) : for leaffile in files : ( yield os . path . join ( root , leaffile ) )
iterator on filenames in base_directories .