@@ -18,7 +18,20 @@ Or in a Jupyter notebook:
1818
1919### Getting the notebooks
2020
21- To get the notebooks that make up this course, either use git to clone the repository at Github:
21+ To get the notebooks that make up this course, you can either use them in
22+ Google Colab, or download them to your own computer.
23+
24+ #### Opening notebooks on Colab:
25+
26+ * Go to File->Open notebook
27+ * Select "Github" tab
28+ * Organization: ualberta-rcg (important: press enter)
29+ * Repository: ualberta-rcg/python-plotting
30+ * Choose the notebook you want
31+
32+ #### Getting notebooks on your computer:
33+
34+ Either use git to clone the repository at Github:
2235
2336```
2437git clone https://github.com/ualberta-rcg/python-plotting.git
@@ -29,7 +42,16 @@ git clone https://github.com/ualberta-rcg/python-plotting.git
2942... or run the following in a Jupyter notebook:
3043
3144```
32- !wget -O python-plotting-master.zip https://github.com/ualberta-rcg/python-plotting/archive/master.zip
33- !unzip python-plotting-master.zip
34- ```
45+ # Downloads and extracts to python-plotting-master directory
46+ # Warning (overwrites notebooks if they exist)
47+ import os, urllib.request, zipfile
48+ def get_notebooks():
49+ url = 'https://github.com/ualberta-rcg/python-plotting/archive/master.zip'
50+ zip_file = 'python-plotting.zip'
51+ if os.path.exists(zip_file): return
52+ urllib.request.urlretrieve(url, zip_file)
53+ with zipfile.ZipFile(zip_file) as zip_ref:
54+ zip_ref.extractall()
3555
56+ get_notebooks()
57+ ```
0 commit comments