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

Quote:
I can't see why you'd want to pass a string in this case.
This script sets some registry keys, these keys need to be changed back to the original values after a while, so I write a backup file with a list of keys and their values, the hive name needs to be included obviously. I guess I can pickle, but I want the file to be plain text so it can be examined&modified if needed.

I can use
if reg == 2147483650:
str = 'HKEY_LOCAL_MACHINE'

But does this work on every system config, and on every Windows version (XP, Vista, 2003, 2008)?
Other than that, it is _ugly_, passing two values (str and reg.HKLM/HKCU) would be better...
__________________
UNIX was not designed to stop you from doing stupid things, because that would also stop you from doing clever things.
Reply With Quote