我收到如下所示的错误。由于空间,它看起来像一个路径问题。
>>> from _winreg import *
>>> aReg = ConnectRegistry(None,HKEY_LOCAL_MACHINE)
>>> print aReg
<PyHKEY at 03216070 (000001C8)>
>>> hKey = OpenKey(aReg, r"SOFTWARE\\Microsoft\\Windows\\Windows Error Reporting\\LocalDumps")
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
WindowsError: [Error 2] The system cannot find the file specified
它正在正确地进入“Windows”。
>>> hKey = OpenKey(aReg, r"SOFTWARE\\Microsoft\\Windows\\")
>>> print hKey
<PyHKEY at 03216050 (000001A0)>