def _RegistryQueryBase(sysdir, key, value):
 if (sys.platform not in ('win32', 'cygwin')):
  return None
 cmd = [os.path.join(os.environ.get('WINDIR', ''), sysdir, 'reg.exe'), 'query', key]
 if value:
  cmd.extend(['/v', value])
 p = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
 text = p.communicate()[0]
 if p.returncode:
  return None
 return text

def _RegistryQueryBase ( sysdir , key , value ) : if ( sys . platform not in ( 'win32' , 'cygwin' ) ) : return None cmd = [ os . path . join ( os . environ . get ( 'WINDIR' , '' ) , sysdir , 'reg.exe' ) , 'query' , key ] if value : cmd . extend ( [ '/v' , value ] ) p = subprocess . Popen ( cmd , stdout = subprocess . PIPE , stderr = subprocess . PIPE ) text = p . communicate ( ) [ 0 ] if p . returncode : return None return text
use reg .