Skip to content

Instantly share code, notes, and snippets.

@paultopia
Created September 4, 2017 02:34
Show Gist options
  • Select an option

  • Save paultopia/05020c7eec92895a346d5baf3bad2f1a to your computer and use it in GitHub Desktop.

Select an option

Save paultopia/05020c7eec92895a346d5baf3bad2f1a to your computer and use it in GitHub Desktop.
script-from-dropbox.py
import requests, appex
from urllib.parse import urlparse
url = appex.get_url().replace("dl=0", "dl=1")
r = requests.get(url)
filename = urlparse(url).path.rpartition("/")[-1].replace(".py", "-downloaded.py")
with open(filename, "wb") as outfile:
outfile.write(r.content)
print("script downloaded as " + filename)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment