Skip to content

Commit 9fc2ab0

Browse files
committed
Updating the blank notebooks
1 parent 767667b commit 9fc2ab0

File tree

1 file changed

+17
-1
lines changed

1 file changed

+17
-1
lines changed

blank/chap02.ipynb

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,23 @@
1818
"tags": []
1919
},
2020
"outputs": [],
21-
"source": []
21+
"source": [
22+
"from os.path import basename, exists\n",
23+
"\n",
24+
"def download(url):\n",
25+
" filename = basename(url)\n",
26+
" if not exists(filename):\n",
27+
" from urllib.request import urlretrieve\n",
28+
"\n",
29+
" local, _ = urlretrieve(url, filename)\n",
30+
" print(\"Downloaded \" + str(local))\n",
31+
" return filename\n",
32+
"\n",
33+
"download('https://github.com/AllenDowney/ThinkPython/raw/v3/thinkpython.py');\n",
34+
"download('https://github.com/AllenDowney/ThinkPython/raw/v3/diagram.py');\n",
35+
"\n",
36+
"import thinkpython"
37+
]
2238
},
2339
{
2440
"cell_type": "markdown",

0 commit comments

Comments
 (0)