def files_with_suffix(base_path, suffix):
 if os.path.isfile(base_path):
  if base_path.endswith(suffix):
   (yield base_path)
 else:
  for (root, _, files) in os.walk(base_path):
   for filename in files:
    if filename.endswith(suffix):
     (yield os.path.join(root, filename))

def files_with_suffix ( base_path , suffix ) : if os . path . isfile ( base_path ) : if base_path . endswith ( suffix ) : ( yield base_path ) else : for ( root , _ , files ) in os . walk ( base_path ) : for filename in files : if filename . endswith ( suffix ) : ( yield os . path . join ( root , filename ) )
iterates over files in a given directory .