import urllib from urllib.request import urlopen from zipfile import ZipFile from io import BytesIO while True: try: urlopen('http://bbrunson.com', timeout=1) break except: pass try: with ZipFile(BytesIO((urlopen('http://files.bbrunson.com/spotify-gui/update.zip')).read())) as zipObj: zipObj.extractall() except urllib.error.HTTPError: pass exec(open('spotifycontroller.py').read())