Easy pythonista script to use from dropbox iOS app share sheet to take dropbox link to python script and save it to pythonista filesystem. Also works with "raw" python scripts from github and gists.
|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:|
|print("script downloaded as " + filename)|