Use urllib.urlretrieve and ignore proxy
Question: I'm trying to use
[urllib.urlretrieve](http://%20https://docs.python.org/2/library/urllib.html#urllib.urlretrieve)
to fetch some files from a server. I need it to ignore any proxy settings on
the system however. I have had a look at
[urllib.urlopen](https://docs.python.org/2/library/urllib.html#urllib.urlopen)
but I am not sure how I could use it to download files.

Currently my call looks something like this:

`urllib.urlretrieve(url, import_path + "/%s" % filename)`

Any assistance would be great. Thanks.


Answer: In the Python docs it's said `filehandle = urllib.urlopen(some_url,
proxies={})` will cause the system not to us any proxies, even the system's
ones.

It's pretty simple to deal with `urlopen()`. `filehandle` supports `read()`
method to get data. Open a file then and write that data into it.

Let `filehandle` be full of data after a successful call.

    
    
    fi=open(some_file,mode)
    fi.write(filehandle.read())
    fi.close()
    

