Created
September 4, 2017 02:34
-
-
Save paultopia/05020c7eec92895a346d5baf3bad2f1a to your computer and use it in GitHub Desktop.
script-from-dropbox.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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