[Tutor] Recursive functions and the windows registry
lucidmonk at gmail.com
Thu Nov 16 17:49:55 CET 2006
I have been fighting with this for a couple of days and am getting
frustrated with it. I am trying to figure out a way to walk through the
windows registry and to capture all nodes under the HKEY_CLASSES_ROOT\CLSID
key and then put it into a list.
I have been trying to do it with a recursive function but am having no luck
with it. I am really hoping that it's because I am new to Python and not
because I am doing something stupid but it would not be the first time I
missed something obvious.
This script is a subset of the larger script that I am working on. Any help
or feedback would be great. I'm getting to the end of my rope.
By the way I don't understand why it seems to work inside the
ListRegistryKeys function but it doesn't pass all the information back to
the parseRegistry function.
import _winreg # _winreg module allows you to work with the windows registry
# if its empty do nothing
if not path: return
name = 
name.append(path + "\\" + _winreg.EnumKey(key, i))
i += 1
for item in name:
guidlist = ListRegistryKeys("CLSID")
for item in guidlist:
print "parseRegistry: ", item
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Tutor