We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 767667b commit 9fc2ab0Copy full SHA for 9fc2ab0
blank/chap02.ipynb
@@ -18,7 +18,23 @@
18
"tags": []
19
},
20
"outputs": [],
21
- "source": []
+ "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
29
+ " local, _ = urlretrieve(url, filename)\n",
30
+ " print(\"Downloaded \" + str(local))\n",
31
+ " return filename\n",
32
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
36
+ "import thinkpython"
37
+ ]
38
39
{
40
"cell_type": "markdown",
0 commit comments