Help with reading WinXP registry

David Flory David.Flory at TheFlorys.org
Mon Aug 16 18:40:52 CEST 2004


I am trying to write a short program to list the keys and values in a
WinXP registry key.  I have tried to use pyRegistry and get an error.
My test code is:

Import pyRegistry
baseKey = "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Themes"
basereg = pyRegistry.open(baseKey) 
print basereg.getKeyNames()

Which gives the error:

Traceback (most recent call last):
  File "D:\bin\test_pyRegistry.py", line 5, in ?
    print basereg.getKeyNames()
AttributeError: getKeyNames

What am I doing wrong?  Using basereg.getValueNames() works fine.

Is there a better way to access the registry in a Win32 system?

Tia, David




More information about the Python-list mailing list