def read_registry(key, valueex): reg_key = OpenKey(HKEY_LOCAL_MACHINE, key, 0, KEY_READ) return QueryValueEx(reg_key, valueex)