View Single Post
  #8   (View Single Post)  
Old 1st April 2009
Carpetsmoker's Avatar
Carpetsmoker Carpetsmoker is offline
Real Name: Martin
Tcpdump Spy
 
Join Date: Apr 2008
Location: Netherlands
Posts: 2,243
Default

eval() works pretty good:

Code:
import _winreg as winreg

SetRegistry(winreg.HKEY_LOCAL_MACHINE, key, values)

def SetRegistry(reg, key, values):
  regobj = eval('winreg.' + reg)
  reghandle = winreg.ConnectRegistry(None, regobj)
__________________
UNIX was not designed to stop you from doing stupid things, because that would also stop you from doing clever things.
Reply With Quote