The Registry

From IronPython Cookbook

Accessing the registry is easy.

First setting a value:

from Microsoft.Win32 import Registry

registryRootNode = "HKEY_CURRENT_USER\\Software\\IronPythonTest\\IronPythonTest"
testKey = "TestKey"
value = "A test value..."

Registry.SetValue(registryRootNode, testKey, value)

Then getting a value:

defaultValue = ''
print Registry.GetValue(registryRootNode , testKey, defaultValue)

See the MSDN docs for more details: Registry Class.


Back to Contents.