def get_stdlib_modules():
 modules = list(sys.builtin_module_names)
 for path in sys.path[1:]:
  if ('site-packages' not in path):
   modules += module_list(path)
 modules = set(modules)
 if ('__init__' in modules):
  modules.remove('__init__')
 modules = list(modules)
 return modules

def get_stdlib_modules ( ) : modules = list ( sys . builtin_module_names ) for path in sys . path [ 1 : ] : if ( 'site-packages' not in path ) : modules += module_list ( path ) modules = set ( modules ) if ( '__init__' in modules ) : modules . remove ( '__init__' ) modules = list ( modules ) return modules
returns a list containing the names of all the modules available in the standard library .