def iterSourceCode(paths):
 for path in paths:
  if os.path.isdir(path):
   for (dirpath, dirnames, filenames) in os.walk(path):
    for filename in filenames:
     if filename.endswith('.py'):
      (yield os.path.join(dirpath, filename))
  else:
   (yield path)

def iterSourceCode ( paths ) : for path in paths : if os . path . isdir ( path ) : for ( dirpath , dirnames , filenames ) in os . walk ( path ) : for filename in filenames : if filename . endswith ( '.py' ) : ( yield os . path . join ( dirpath , filename ) ) else : ( yield path )
iterate over all python source files in c{paths} .