Last active
September 8, 2023 05:52
-
-
Save jlehikoinen/ebbb77b366d908243ad6 to your computer and use it in GitHub Desktop.
Pythonista setup script for https://github.com/jlehikoinen/pythonista-flask-example
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
""" | |
setup_example.py | |
Run this script from the Pythonista Documents root | |
Setup script for https://github.com/jlehikoinen/pythonista-flask-example | |
""" | |
import requests | |
import zipfile | |
import urllib | |
import tempfile | |
### | |
# Download and extract GitHub repo zip | |
print 'Downloading and extracting pythonista-flask-example.zip..' | |
zip_url = 'https://github.com/jlehikoinen/pythonista-flask-example/archive/master.zip' | |
try: | |
with tempfile.NamedTemporaryFile(mode='w+b',suffix='.zip') as f: | |
urllib.urlretrieve(zip_url, f.name) | |
local_zip = zipfile.ZipFile(f) | |
local_zip.extractall() | |
except Exception as e: | |
print 'Error: ' + str(e) | |
print('Download failed') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment