Skip to content

Instantly share code, notes, and snippets.

@hibryid
Created March 9, 2020 02:03
Show Gist options
  • Save hibryid/db1b4e72bda8430aafc7840689d0ff11 to your computer and use it in GitHub Desktop.
Save hibryid/db1b4e72bda8430aafc7840689d0ff11 to your computer and use it in GitHub Desktop.
import os, sys, subprocess
import requests
from time import sleep
print("started new script")
scriptname = os.path.basename(__file__)
url = "https://raw.githubusercontent.com/hibryid/Testupdate/master/update.py"
r = requests.get(url)
with open(scriptname, 'wb') as f:
f.write(r.content)
print("Done downloading")
while True:
print("sleeping enough")
sleep(15)
print(os.path.basename(__file__))
os.execl(sys.executable, sys.executable, * sys.argv)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment