From f950abe00a7504027b029ce1ef602f68144b0ff9 Mon Sep 17 00:00:00 2001 From: Matthias Geier Date: Tue, 26 Jan 2016 10:58:30 +0100 Subject: [PATCH] nbconvert_library.ipynb: use urllib.request instead of requests --- docs/source/nbconvert_library.ipynb | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/docs/source/nbconvert_library.ipynb b/docs/source/nbconvert_library.ipynb index 8039dabb7..95cb27c3a 100644 --- a/docs/source/nbconvert_library.ipynb +++ b/docs/source/nbconvert_library.ipynb @@ -42,9 +42,11 @@ }, "outputs": [], "source": [ - "import requests\n", - "response = requests.get('http://jakevdp.github.com/downloads/notebooks/XKCD_plots.ipynb')\n", - "response.text[0:60] + '...'" + "from urllib.request import urlopen\n", + "\n", + "url = 'http://jakevdp.github.com/downloads/notebooks/XKCD_plots.ipynb'\n", + "response = urlopen(url).read().decode()\n", + "response[0:60] + ' ...'" ] }, { @@ -65,7 +67,7 @@ "outputs": [], "source": [ "import nbformat\n", - "jake_notebook = nbformat.reads(response.text, as_version=4)\n", + "jake_notebook = nbformat.reads(response, as_version=4)\n", "jake_notebook.cells[0]" ] }, @@ -479,7 +481,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.5.1" + "version": "3.4.4" } }, "nbformat": 4,