Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #41256 > unrolled thread

changes on windows registry doesn’t take effect immediately

Started byiMath <redstone-cold@163.com>
First post2013-03-14 22:26 -0700
Last post2013-03-14 23:16 -0700
Articles 3 — 3 participants

Back to article view | Back to comp.lang.python


Contents

  changes on windows registry doesn’t take effect immediately iMath <redstone-cold@163.com> - 2013-03-14 22:26 -0700
    Re: changes on windows registry doesn’t take effect immediately Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2013-03-15 05:56 +0000
    Re: changes on windows registry doesn’t take effect immediately Tim Roberts <timr@probo.com> - 2013-03-14 23:16 -0700

#41256 — changes on windows registry doesn’t take effect immediately

FromiMath <redstone-cold@163.com>
Date2013-03-14 22:26 -0700
Subjectchanges on windows registry doesn’t take effect immediately
Message-ID<8f25a1bd-208a-4521-b233-5e26d802ccac@googlegroups.com>
changes on windows registry doesn’t take effect immediately

I am trying to change IE’s proxy settings by the following 2 code snippets 

to enable the proxy by this code 

from winreg import *
with OpenKey(HKEY_CURRENT_USER,r"Software\Microsoft\Windows\CurrentVersion\Internet Settings" ,0, KEY_ALL_ACCESS) as key:
    SetValueEx(key,"ProxyServer",0, REG_SZ, "127.0.0.1:8087")
    SetValueEx(key,"ProxyEnable",0, REG_DWORD, 1)
    SetValueEx(key,"ProxyOverride",0, REG_SZ, "<local>")
FlushKey(key)

to disable the proxy by this code 

from winreg import *
with OpenKey(HKEY_CURRENT_USER,r"Software\Microsoft\Windows\CurrentVersion\Internet Settings" ,0, KEY_ALL_ACCESS) as key:

    DeleteValue(key,"ProxyServer")
    SetValueEx(key,"ProxyEnable",0, REG_DWORD, 0)
    DeleteValue(key,"ProxyOverride")
    FlushKey(key)

but the changes on windows registry doesn’t take effect immediately,so is there some way to change the windows registry and let the changes  take effect immediately without restarting IE ?

BTW ,I use the code on winxp ,and I am going to embed the 2 code snippets in my PyQt application .

[toc] | [next] | [standalone]


#41257

FromSteven D'Aprano <steve+comp.lang.python@pearwood.info>
Date2013-03-15 05:56 +0000
Message-ID<5142b817$0$29965$c3e8da3$5496439d@news.astraweb.com>
In reply to#41256
On Thu, 14 Mar 2013 22:26:50 -0700, iMath wrote:

> changes on windows registry doesn’t take effect immediately
> 
> I am trying to change IE’s proxy settings by the following 2 code
> snippets
[...]
> but the changes on windows registry doesn’t take effect immediately,so
> is there some way to change the windows registry and let the changes 
> take effect immediately without restarting IE ?

That's an IE question, not a Python question. You might be lucky and have 
somebody here happen to know the answer, but you'll probably have more 
luck asking on a group dedicated to Windows and IE.



-- 
Steven

[toc] | [prev] | [next] | [standalone]


#41258 — Re: changes on windows registry doesn’t take effect immediately

FromTim Roberts <timr@probo.com>
Date2013-03-14 23:16 -0700
SubjectRe: changes on windows registry doesn’t take effect immediately
Message-ID<c3f5k8diu7pd0f9ndkf8t1lkrt2eq630t6@4ax.com>
In reply to#41256
iMath <redstone-cold@163.com> wrote:
>
>changes on windows registry doesn’t take effect immediately

Well, that's not exactly the issue.  The registry is being changed
immediately.  The issue is that IE doesn't check for proxy settings
continuously.

>but the changes on windows registry doesn’t take effect immediately, so
>is there some way to change the windows registry and let the changes
>take effect immediately without restarting IE ?

No.  This is an IE issue, not a registry issue.  Other browsers might
behave differently.
-- 
Tim Roberts, timr@probo.com
Providenza & Boekelheide, Inc.

[toc] | [prev] | [standalone]


Back to top | Article view | comp.lang.python


csiph-web