Skip to content

Commit 4d98937

Browse files
authored
Merge pull request ipython#54 from minrk/binder
make it work on Binder
2 parents c6c1e0d + f788518 commit 4d98937

File tree

7 files changed

+155
-53
lines changed

7 files changed

+155
-53
lines changed

README.md

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,22 @@
11
# IPython in depth tutorial
22

3+
Try it out on Binder! [![Binder](https://mybinder.org/badge.svg)](https://mybinder.org/v2/gh/ipython/ipython-in-depth/master?filepath=binder%2FIndex.ipynb)
4+
35
In its current form, this tutorial is meant to be executed with Jupyter notebook
46
5.0, using IPython 6.0 or newer on Python 3, the latest IPython version
57
compatible with Python 2 is IPython 5.x that may not have the exact same
6-
behavior and all the features presented in this tutorial.
8+
behavior and all the features presented in this tutorial.
79

810

911
You can find our installation instructions [for
10-
IPython](http://ipython.org/install.html) and [Jupyter
11-
notebook](http://jupyter.readthedocs.io/en/latest/install.html)
12+
IPython](https://ipython.org/install.html) and [Jupyter
13+
notebook](https://jupyter.readthedocs.io/en/latest/install.html)
1214

1315
To get the tutorial, checkout the `ipython-in-depth` repo:
1416

1517
git clone https://github.com/ipython/ipython-in-depth
1618

17-
Or just [download current
19+
Or [download current
1820
master](https://github.com/ipython/ipython-in-depth/zipball/master) and unzip
1921
it.
2022

@@ -35,7 +37,7 @@ Change directory inside the directory newly created:
3537

3638
cd ipython-in-depth
3739

38-
You can then start the IPython notebook server at a terminal with:
40+
You can then start the Jupyter notebook server at a terminal with:
3941

4042
jupyter notebook
4143

@@ -50,4 +52,4 @@ time:
5052
$ docker pull jupyter/datascience-notebook
5153

5254
The image contains a installation of the Jupyter notebook with R, Julia,
53-
Python2, Python3 and a couple of library for each language.
55+
Python2, Python3 and a couple of libraries for each language.

binder/Index.ipynb

Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
{
2+
"cells": [
3+
{
4+
"cell_type": "markdown",
5+
"metadata": {},
6+
"source": [
7+
"# Welcome to Jupyter!"
8+
]
9+
},
10+
{
11+
"cell_type": "markdown",
12+
"metadata": {},
13+
"source": [
14+
"This repo contains an introduction to [Jupyter](https://jupyter.org) and [IPython](https://ipython.org).\n",
15+
"\n",
16+
"Outline of some basics:\n",
17+
"\n",
18+
"* [Notebook Basics](../examples/Notebook/Notebook Basics.ipynb)\n",
19+
"* [IPython - beyond plain python](../examples/IPython Kernel/Beyond Plain Python.ipynb)\n",
20+
"* [Markdown Cells](../examples/Notebook/Working With Markdown Cells.ipynb)\n",
21+
"* [Rich Display System](../examples/IPython Kernel/Rich Output.ipynb)\n",
22+
"* [Custom Display logic](../examples/IPython%20Kernel/Custom%20Display%20Logic.ipynb)\n",
23+
"* [Running a Secure Public Notebook Server](../examples/Notebook/Running%20the%20Notebook%20Server.ipynb#Securing-the-notebook-server)\n",
24+
"* [How Jupyter works](../examples/Notebook/Multiple%20Languages%2C%20Frontends.ipynb) to run code in different languages."
25+
]
26+
},
27+
{
28+
"cell_type": "markdown",
29+
"metadata": {},
30+
"source": [
31+
"You can also get this tutorial and run it on your laptop:\n",
32+
"\n",
33+
" git clone https://github.com/ipython/ipython-in-depth\n",
34+
"\n",
35+
"Install IPython and Jupyter:\n",
36+
"\n",
37+
"with [conda](https://www.anaconda.com/download):\n",
38+
"\n",
39+
" conda install ipython jupyter\n",
40+
"\n",
41+
"with pip:\n",
42+
"\n",
43+
" # first, always upgrade pip!\n",
44+
" pip install --upgrade pip\n",
45+
" pip install --upgrade ipython jupyter\n",
46+
"\n",
47+
"Start the notebook in the tutorial directory:\n",
48+
"\n",
49+
" cd ipython-in-depth\n",
50+
" jupyter notebook"
51+
]
52+
}
53+
],
54+
"metadata": {
55+
"kernelspec": {
56+
"display_name": "Python 3",
57+
"language": "python",
58+
"name": "python3"
59+
},
60+
"language_info": {
61+
"codemirror_mode": {
62+
"name": "ipython",
63+
"version": 3
64+
},
65+
"file_extension": ".py",
66+
"mimetype": "text/x-python",
67+
"name": "python",
68+
"nbconvert_exporter": "python",
69+
"pygments_lexer": "ipython3",
70+
"version": "3.6.3"
71+
}
72+
},
73+
"nbformat": 4,
74+
"nbformat_minor": 2
75+
}

binder/apt.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
texlive

binder/environment.yml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
channels:
2+
- conda-forge
3+
- defaults
4+
dependencies:
5+
- python=3.6
6+
- cython
7+
- ipython
8+
- ipyparallel
9+
- ipywidgets
10+
- numpy
11+
- matplotlib
12+
- mpi4py
13+
- networkx
14+
- pandas
15+
- scikit-image
16+
- scikit-learn
17+
- sympy

examples/Notebook/Multiple Languages, Frontends.ipynb

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@
44
"cell_type": "markdown",
55
"metadata": {},
66
"source": [
7-
"# How IPython works\n",
7+
"# How Jupyter works\n",
88
"\n",
99
"\n",
10-
"## Terminal IPython\n",
10+
"## ...But first, Terminal IPython\n",
1111
"\n",
1212
"When you type `ipython`, you get the original IPython interface, running in\n",
1313
"the terminal. It does something like this:\n",
@@ -19,7 +19,7 @@
1919
"```\n",
2020
"\n",
2121
"Of course, it's much more complex, because it has to deal with multi-line\n",
22-
"code, tab completion using `readline`, magic commands, and so on. But the\n",
22+
"code, tab completion using `readline` or `prompt-toolkit`, magic commands, and so on. But the\n",
2323
"model is like that: prompt the user for some code, and when they've entered it,\n",
2424
"exec it in the same process. This model is often called a REPL, or\n",
2525
"Read-Eval-Print-Loop."
@@ -29,14 +29,14 @@
2929
"cell_type": "markdown",
3030
"metadata": {},
3131
"source": [
32-
"## The IPython Kernel\n",
32+
"## Jupyter and The IPython Kernel\n",
3333
"\n",
34-
"All the other interfacesthe Notebook, the Qt console, `ipython console` in\n",
34+
"Jupyter expands on this REPL model and provides other interfaces to running code–the notebook, the Qt console, `jupyter console` in\n",
3535
"the terminal, and third party interfaces—use the IPython Kernel. This is a\n",
3636
"separate process which is responsible for running user code, and things like\n",
3737
"computing possible completions. Frontends communicate with it using JSON\n",
3838
"messages sent over [ZeroMQ](http://zeromq.org/) sockets; the protocol they use is described in\n",
39-
":doc:`messaging`.\n",
39+
"[the jupyter protocol](https://jupyter-client.readthedocs.io/en/stable/messaging.html).\n",
4040
"\n",
4141
"The core execution machinery for the kernel is shared with terminal IPython:\n",
4242
"\n",
@@ -213,7 +213,7 @@
213213
"name": "python",
214214
"nbconvert_exporter": "python",
215215
"pygments_lexer": "ipython3",
216-
"version": "3.6.0"
216+
"version": "3.6.3"
217217
}
218218
},
219219
"nbformat": 4,

examples/Notebook/Running Code.ipynb

Lines changed: 25 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -30,21 +30,17 @@
3030
},
3131
{
3232
"cell_type": "code",
33-
"execution_count": 1,
34-
"metadata": {
35-
"collapsed": false
36-
},
33+
"execution_count": 3,
34+
"metadata": {},
3735
"outputs": [],
3836
"source": [
3937
"a = 10"
4038
]
4139
},
4240
{
4341
"cell_type": "code",
44-
"execution_count": 2,
45-
"metadata": {
46-
"collapsed": false
47-
},
42+
"execution_count": 4,
43+
"metadata": {},
4844
"outputs": [
4945
{
5046
"name": "stdout",
@@ -85,9 +81,7 @@
8581
{
8682
"cell_type": "code",
8783
"execution_count": null,
88-
"metadata": {
89-
"collapsed": false
90-
},
84+
"metadata": {},
9185
"outputs": [],
9286
"source": [
9387
"import time\n",
@@ -105,9 +99,7 @@
10599
{
106100
"cell_type": "code",
107101
"execution_count": null,
108-
"metadata": {
109-
"collapsed": false
110-
},
102+
"metadata": {},
111103
"outputs": [],
112104
"source": [
113105
"import sys\n",
@@ -170,9 +162,7 @@
170162
{
171163
"cell_type": "code",
172164
"execution_count": 2,
173-
"metadata": {
174-
"collapsed": false
175-
},
165+
"metadata": {},
176166
"outputs": [
177167
{
178168
"name": "stdout",
@@ -189,9 +179,7 @@
189179
{
190180
"cell_type": "code",
191181
"execution_count": 3,
192-
"metadata": {
193-
"collapsed": false
194-
},
182+
"metadata": {},
195183
"outputs": [
196184
{
197185
"name": "stderr",
@@ -223,9 +211,7 @@
223211
{
224212
"cell_type": "code",
225213
"execution_count": 4,
226-
"metadata": {
227-
"collapsed": false
228-
},
214+
"metadata": {},
229215
"outputs": [
230216
{
231217
"name": "stdout",
@@ -266,9 +252,7 @@
266252
{
267253
"cell_type": "code",
268254
"execution_count": 5,
269-
"metadata": {
270-
"collapsed": false
271-
},
255+
"metadata": {},
272256
"outputs": [
273257
{
274258
"name": "stdout",
@@ -342,9 +326,7 @@
342326
{
343327
"cell_type": "code",
344328
"execution_count": 6,
345-
"metadata": {
346-
"collapsed": false
347-
},
329+
"metadata": {},
348330
"outputs": [
349331
{
350332
"name": "stdout",
@@ -861,24 +843,30 @@
861843
{
862844
"cell_type": "code",
863845
"execution_count": null,
864-
"metadata": {
865-
"collapsed": false
866-
},
846+
"metadata": {},
867847
"outputs": [],
868848
"source": []
869849
}
870850
],
871851
"metadata": {
872852
"kernelspec": {
853+
"display_name": "Python 3",
854+
"language": "python",
855+
"name": "python3"
856+
},
857+
"language_info": {
873858
"codemirror_mode": {
874859
"name": "ipython",
875860
"version": 3
876861
},
877-
"display_name": "IPython (Python 3)",
878-
"language": "python",
879-
"name": "python3"
862+
"file_extension": ".py",
863+
"mimetype": "text/x-python",
864+
"name": "python",
865+
"nbconvert_exporter": "python",
866+
"pygments_lexer": "ipython3",
867+
"version": "3.6.2"
880868
}
881869
},
882870
"nbformat": 4,
883-
"nbformat_minor": 0
884-
}
871+
"nbformat_minor": 1
872+
}

examples/Notebook/Typesetting Equations.ipynb

Lines changed: 22 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
"\\end{align}\n",
2525
"```\n",
2626
"### Display\n",
27+
"\n",
2728
"\\begin{align}\n",
2829
"\\dot{x} & = \\sigma(y-x) \\\\\n",
2930
"\\dot{y} & = \\rho x - y - xz \\\\\n",
@@ -247,7 +248,25 @@
247248
]
248249
}
249250
],
250-
"metadata": {},
251+
"metadata": {
252+
"kernelspec": {
253+
"display_name": "Python 3",
254+
"language": "python",
255+
"name": "python3"
256+
},
257+
"language_info": {
258+
"codemirror_mode": {
259+
"name": "ipython",
260+
"version": 3
261+
},
262+
"file_extension": ".py",
263+
"mimetype": "text/x-python",
264+
"name": "python",
265+
"nbconvert_exporter": "python",
266+
"pygments_lexer": "ipython3",
267+
"version": "3.6.2"
268+
}
269+
},
251270
"nbformat": 4,
252-
"nbformat_minor": 0
253-
}
271+
"nbformat_minor": 1
272+
}

0 commit comments

Comments
 (0)