1

I need to download a file using a python script when i am in the office ... Long term goal is to give this out to my team mates but need to fix the proxy issue

Here is the code I am using right now

import urllib.request
import shutil

url = "https://download/app/client/app.exe"
output_file = "C:\\Desktop\\testing\\App.exe"
with urllib.request.urlopen(url) as response, open(output_file, 'wb') as out_file:
    shutil.copyfileobj(response, out_file)

When i launch this script it just hangs and I know it is because of the proxy issue .... How can i set this to use my corporate proxy? Ideally it would be great to get this to use proxy settings based on location (home vs office) but i will take what i can get

dustybusty12
  • 107
  • 1
  • 7
  • 14
  • 1
    Perhaps this answer will help - https://stackoverflow.com/a/3168244/2570277 or this one https://stackoverflow.com/a/34577116/2570277 – Nick Mar 28 '19 at 09:27

0 Answers0