Changing proxies with urllib

David Leinbach leinbach at telus.net
Sat Nov 11 19:55:00 EST 2000


Thank you

Radovan Garabik wrote:

> David Leinbach <leinbach at telus.net> wrote:
>  : If I am using urllib to open a webpage, how can change what proxy it
>  : goes through while my program is running?  Can I just change the
>  : environment variable?   Thanks
>
> No, (at least under unix) it is impossible to change the environmental
> variable from within script.
> However, you can change the values in os.environ dictionary,
> and urllib uses these values, so the resulting behaviour is exactly
> what you want.
>
> --
>  -----------------------------------------------------------
> | Radovan Garabik http://melkor.dnp.fmph.uniba.sk/~garabik/ |
> | __..--^^^--..__    garabik @ melkor.dnp.fmph.uniba.sk     |
>  -----------------------------------------------------------
> Antivirus alert: file .signature infected by signature virus.
> Hi! I'm a signature virus! Copy me into your signature file to help me spread!




More information about the Python-list mailing list