[Tutor] URLLIB Proxy Question

Hans Nowak hnowak@cuci.nl
Mon, 31 Jan 2000 23:25:59 +0100

On 31 Jan 00, at 16:06, Curtis Larsen wrote:

> I'm new to Python and am trying to get the URLLIB working using an HTTP
> proxy, but I can't seem to get the magic combination together.
> I set up a variable named "http_proxy" with the (apparent?) value of
> "http://servername:port/", but it's still no go.
> The latest error message I receive is "AssertionError: proxies must be a
> mapping"
> A "mapping" what...?

A dictionary. For example:

  proxies = {'http': ''}

then use

  urlopener = urllib.FancyURLopener(proxies)


--Hans Nowak (zephyrfalcon@hvision.nl)
Homepage: http://fly.to/zephyrfalcon
You call me a masterless man. You are wrong. I am my own master.