def valuestodict(key):
 dict = {}
 size = winreg.QueryInfoKey(key)[1]
 for i in range(size):
  data = winreg.EnumValue(key, i)
  dict[data[0]] = data[1]
 return dict

def valuestodict ( key ) : dict = { } size = winreg . QueryInfoKey ( key ) [ 1 ] for i in range ( size ) : data = winreg . EnumValue ( key , i ) dict [ data [ 0 ] ] = data [ 1 ] return dict
convert a registry keys values to a dictionary .