What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Skype & Technology » Tech Talk » python reg read

2 votes - 3 average   python reg read
Author: Message:
Jarrod
Veteran Member
*****

Avatar
woot simpson

Posts: 1304
Reputation: 20
– / Male / Flag
Joined: Sep 2006
O.P. python reg read
i'm trying to detect the default proxy settings
i was planning o reading them from
HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings\
REG_SZ ProxyServer
but i can't work out how to use _winreg, and i can't find many examples,
so does anyone know of some code?

i'm also thinking of using twisted.conch instead of tunnelier like i thought if anyone is interested in helping it would be appreciated and possibally rewarded

This post was edited on 11-26-2008 at 12:08 PM by Jarrod.

[Image: 5344.png]
[Image: sig.png]

A.k.a. The Glad Falconer














11-26-2008 11:20 AM
Profile E-Mail PM Find Quote Report
segosa
Community's Choice
*****


Posts: 1407
Reputation: 92
Joined: Feb 2003
RE: python reg read
you can't find anything on it?

http://www.python.org/doc/2.5.2/lib/module--winreg.html

looks pretty detailed to me..
The previous sentence is false. The following sentence is true.
12-16-2008 01:51 AM
Profile PM Find Quote Report
Jarrod
Veteran Member
*****

Avatar
woot simpson

Posts: 1304
Reputation: 20
– / Male / Flag
Joined: Sep 2006
O.P. RE: python reg read
yeah i saw that it doesn't quite help

[Image: 5344.png]
[Image: sig.png]

A.k.a. The Glad Falconer














12-16-2008 02:08 AM
Profile E-Mail PM Find Quote Report
segosa
Community's Choice
*****


Posts: 1407
Reputation: 92
Joined: Feb 2003
RE: python reg read
what do you mean it doesn't help? it outlines all the methods.

code:
import _winreg

registry = _winreg.ConnectRegistry(None, _winreg.HKEY_CURRENT_USER)
key = _winreg.OpenKey(registry, r"Software\Paint.NET")
print _winreg.QueryValueEx(key, "ColorsForm.SnappedTo")


as specified in the documentation, you get a tuple back:

(u'appWorkspace', 1)

the first item being the value, the second the type (1 = REG_SZ).

if you need to do something more complicated like enumerate a key, then use the appropriate method on the page. I don't know how to help you when all the help you need is there.

This post was edited on 12-16-2008 at 02:57 AM by segosa.
The previous sentence is false. The following sentence is true.
12-16-2008 02:54 AM
Profile PM Find Quote Report
TheSteve
Full Member
***

Avatar
The Man from Japan

Posts: 179
Reputation: 23
40 / Male / Flag
Joined: Aug 2005
RE: python reg read
Forgive my lack of python experience, but I think it would look something like this:

code:
iesettings = _winreg.OpenKey(
    _winreg.HKEY_CURRENT_USER,
    "Software\\Microsoft\\Windows\\CurrentVersion\\Internet Settings"
    )
    value, type = _winreg.QueryValueEx(iesettings,"ProxyServer")

    # do something with the value and data.

    _winreg.CloseKey(iesettings)

12-16-2008 02:59 AM
Profile PM Web Find Quote Report
« Next Oldest Return to Top Next Newest »


Threaded Mode | Linear Mode
View a Printable Version
Send this Thread to a Friend
Subscribe | Add to Favorites
Rate This Thread:

Forum Jump:

Forum Rules:
You cannot post new threads
You cannot post replies
You cannot post attachments
You can edit your posts
HTML is Off
myCode is On
Smilies are On
[img] Code is On