def readName(keyPath, name): # return the value of single path and name explorer = OpenKey(HKEY_LOCAL_MACHINE,keyPath, 0, KEY_READ | KEY_WOW64_64KEY) return str(QueryValueEx(explorer, name)[0])