On 1:59 PM, Tim Golden wrote:
On 28/04/2010 14:23, Mike Driscoll wrote:

Sorry for the delay in checking this out. I was out of the office
yesterday. Your code almost worked for reading the key, but I get a
tuple back:

[goes back to check what he wrote...]

That's why my code does this (note the nearly-invisible
underscore before the equals), discarding the datatype
value which is the second item of the tuple returned:

username, _ = _winreg.QueryValueEx (k, "UserName")

TJG


Ah...I must have had something in my eye at the time. Anyway, I figured out how to get the information from it, but not how to write it. I tried writing to the Registry using _winreg.SetValueEx and passed a plain string and then various encoded strings (like utf16, utf32, etc). It writes just fine, but if I open Microsoft Word and check for the new initials or Full Name, Word just shows junk.

- Mike

_______________________________________________
python-win32 mailing list
python-win32@python.org
http://mail.python.org/mailman/listinfo/python-win32

Reply via email to