def _RegistryGetValueUsingWinReg(key, value):
 import _winreg
 try:
  (root, subkey) = key.split('\\', 1)
  assert (root == 'HKLM')
  with _winreg.OpenKey(_winreg.HKEY_LOCAL_MACHINE, subkey) as hkey:
   return _winreg.QueryValueEx(hkey, value)[0]
 except WindowsError:
  return None

def _RegistryGetValueUsingWinReg ( key , value ) : import _winreg try : ( root , subkey ) = key . split ( '\\' , 1 ) assert ( root == 'HKLM' ) with _winreg . OpenKey ( _winreg . HKEY_LOCAL_MACHINE , subkey ) as hkey : return _winreg . QueryValueEx ( hkey , value ) [ 0 ] except WindowsError : return None
use the _winreg module to obtain the value of a registry key .