Python read registry problems, help

Read registry by Python in the Windows 200364 bit system, code:
  1. UnInsKey = 'SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall'
  1. Key = _winreg.OpenKey(_winreg.HKEY_LOCAL_MACHINE, UnInsKey)
Why in 32 bit system is successful, but it opened on 64 bit systems is the path:
SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall

Change as follows, permission is not wrong
  1. Key = _winreg.OpenKey(_winreg.HKEY_LOCAL_MACHINE, UnInsKey, 0,_winreg.KEY_WOW64_64KEY)
WindowsError: [Error 5] Access is denied

Started by Ignativs at February 24, 2016 - 9:43 AM

No, nobody knows.

Posted by Ignativs at March 04, 2016 - 10:32 AM

The landlord is what version of Python? X32 or x64?

Posted by Clare at March 06, 2016 - 10:39 AM

My Pythong program into 32 bits of exe, when playing into the 64 bit can. But I just want to play 32 bit packet

Posted by Ignativs at March 12, 2016 - 11:16 AM

Have information to join
  1. _winreg.KEY_WOW64_64KEY
OK, but why can not access.

Posted by Ignativs at March 17, 2016 - 12:10 PM

Run the program the user permissions are administrator? Or give the registry access, modify permissions.?

Posted by Clare at March 24, 2016 - 12:46 PM

The system is Windows 2003 64bit, sign in with Administrator, do not know if there is no authority,
Oh, really a headache

Posted by Ignativs at April 08, 2016 - 1:39 PM

In the python official Webpage, here are two keys are unique to 64bit:
(URL: )
34.3.1.2.1. 64-bit Specific

For more information, see Accesing an Alternate Registry View.

_winreg.KEY_WOW64_64KEY

Indicates that an application on 64-bit Windows should operate on the 64-bit registry view.

_winreg.KEY_WOW64_32KEY

Indicates that an application on 64-bit Windows should operate on the 32-bit registry view.

So, if it is based on corresponding version is already installed on the platform of Python to run the script, should not be a problem.
But, if it is compiled into a exe, it should be 64.

Posted by Kirk at April 16, 2016 - 2:14 PM

Compiled into 64bit exe in the 64bit system, is not the problem,
The same code, compiled into 32bit exe, running in the 64bit system.,
It is not a solution.

Posted by Ignativs at April 20, 2016 - 2:43 PM