Winreg is an object-oriented wrapper of the _winreg module. It allows for easy access to and manipulation of the Windows Registry, in a consistent manner.
As of version 0.2, WinReg requires Python 2.2. If people would like to be able to use WinReg with earlier versions, please let me know.
>>> from winreg import * >>> key = Key(HKCU, 'SOFTWARE\\Microsoft\\Command Processor') >>> if key.values['CompletionChar'] != 9: ... key.values['CompletionChar'] = 9 >>>
>>> from winreg import Key
>>> key = Key('HKEY_CLASSES_ROOT', '.py')
>>> print len(key.keys)
0
>>> print len(key.values)
2
>>> for v in key.values:
... print "%s=%s" % (`v.name`, v.value,)
''=Python.File
'Content Type'=text/plain
>>> v = key.values.set('{test}', 'delete me')
>>> print len(key.value)
3
>>> print v.value
delete me
>>> v.delete()
>>> print len(key.values)
2
Python License.
Please feel free to contact me with questions, comments, suggestions, or bug reports at oliver@rutherfurd.net.