As the MSDN article you are referring to, it is explained that in 64-bit Windows there are two types of registry: one for 32-bit and one for 64-bit. By default, a 32-bit application (for example, your Python script executed by the 32-bit Python interpreter) will gain access to the 32-bit representation. You can force it to access the 64-bit view using the flags mentioned in the MSDN article. To use these flags, you need to call _winreg.OpenKey , _winreg.CreateKeyEx or _winreg.DeleteKeyEx with the correct parameters, for example.
handle = _winreg.OpenKey(_winreg.HKEY_CURRENT_USER, "your_sub_key", 0, _winreg.KEY_READ | _winreg.KEY_WOW64_64KEY)
See the _winreg documentation for more information.
source share