_winreg.saveKey question

Larry Bates larry dot bates at websafe dot com
Mon Oct 23 21:19:16 CEST 2006

> remotekey = _winreg.OpenKey(rhostreg, key)

Try adding the sam=_winreg.KEY_SET_VALUE parameter.

Help on built-in function OpenKey in module _winreg:

    key = OpenKey(key, sub_key, res = 0, sam = KEY_READ) - Opens the
          specified key.

    key is an already open key, or any one of the predefined HKEY_* constants.
    sub_key is a string that identifies the sub_key to open
    res is a reserved integer, and must be zero.  Default is zero.
    sam is an integer that specifies an access mask that describes the desired
     security access for the key.  Default is KEY_READ

    The result is a new handle to the specified key
    If the function fails, an EnvironmentError exception is raised.

The default is KEY_READ so you can't update.

-Larry Bates

More information about the Python-list mailing list