def _get_services():
 handle_scm = win32service.OpenSCManager(None, None, win32service.SC_MANAGER_ENUMERATE_SERVICE)
 try:
  services = win32service.EnumServicesStatusEx(handle_scm)
 except AttributeError:
  services = win32service.EnumServicesStatus(handle_scm)
 finally:
  win32service.CloseServiceHandle(handle_scm)
 return services

def _get_services ( ) : handle_scm = win32service . OpenSCManager ( None , None , win32service . SC_MANAGER_ENUMERATE_SERVICE ) try : services = win32service . EnumServicesStatusEx ( handle_scm ) except AttributeError : services = win32service . EnumServicesStatus ( handle_scm ) finally : win32service . CloseServiceHandle ( handle_scm ) return services
returns a list of all services on the system .