##// END OF EJS Templates
Adding moved content.
Brian E. Granger -
Show More
@@ -1,248 +1,389 b''
1 {
1 {
2 "metadata": {
2 "metadata": {
3 "name": "",
3 "name": "",
4 "signature": "sha256:84fa8b285a29d021b31d7211c6452729fb042a5c74cee6bf31e74e06fdd26b97"
4 "signature": "sha256:ee4b22b4c949fe21b3e5cda24f0916ba59d8c09443f4a897d98b96d4a73ac335"
5 },
5 },
6 "nbformat": 3,
6 "nbformat": 3,
7 "nbformat_minor": 0,
7 "nbformat_minor": 0,
8 "worksheets": [
8 "worksheets": [
9 {
9 {
10 "cells": [
10 "cells": [
11 {
11 {
12 "cell_type": "heading",
12 "cell_type": "heading",
13 "level": 1,
13 "level": 1,
14 "metadata": {},
14 "metadata": {},
15 "source": [
15 "source": [
16 "Running the Notebook Server"
16 "Running the Notebook Server"
17 ]
17 ]
18 },
18 },
19 {
19 {
20 "cell_type": "markdown",
20 "cell_type": "markdown",
21 "metadata": {},
21 "metadata": {},
22 "source": [
22 "source": [
23 "The IPython notebook server is a custom web server that runs the notebook web application. Most of the time, users run the notebook server on their local computer using IPython's command line interface."
23 "The IPython notebook server is a custom web server that runs the notebook web application. Most of the time, users run the notebook server on their local computer using IPython's command line interface."
24 ]
24 ]
25 },
25 },
26 {
26 {
27 "cell_type": "heading",
27 "cell_type": "heading",
28 "level": 2,
28 "level": 2,
29 "metadata": {},
29 "metadata": {},
30 "source": [
30 "source": [
31 "Starting the notebook server using the command line"
31 "Starting the notebook server using the command line"
32 ]
32 ]
33 },
33 },
34 {
34 {
35 "cell_type": "markdown",
35 "cell_type": "markdown",
36 "metadata": {},
36 "metadata": {},
37 "source": [
37 "source": [
38 "You can start the notebook server from the command line (Terminal on Mac/Linux, CMD prompt on Windows) by running the following command: \n",
38 "You can start the notebook server from the command line (Terminal on Mac/Linux, CMD prompt on Windows) by running the following command: \n",
39 "\n",
39 "\n",
40 " ipython notebook\n",
40 " ipython notebook\n",
41 "\n",
41 "\n",
42 "This will print some information about the notebook server in your console, including the URL of the web application (by default, `http://127.0.0.1:8888`). It will then open your default web browser to this URL.\n",
42 "This will print some information about the notebook server in your terminal, including the URL of the web application (by default, `http://127.0.0.1:8888`). It will then open your default web browser to this URL.\n",
43 "\n",
43 "\n",
44 "When the notebook opens, you will see the **notebook dashboard**, which will show a list of the notebooks and subdirectories in the directory where the notebook server was started. As of IPython 2.0, the dashboard allows you to navigate to different subdirectories. Because of this, it is no longer necessary to start a separate notebook server for each subdirectory. Most of the time, you will want to start a notebook server in the highest directory in your filesystem where notebooks can be found. Often this will be your home directory.\n",
44 "When the notebook opens, you will see the **notebook dashboard**, which will show a list of the notebooks and subdirectories in the directory where the notebook server was started. As of IPython 2.0, the dashboard allows you to navigate to different subdirectories. Because of this, it is no longer necessary to start a separate notebook server for each subdirectory. Most of the time, you will want to start a notebook server in the highest directory in your filesystem where notebooks can be found. Often this will be your home directory.\n",
45 "\n",
45 "\n",
46 "You can start more than one notebook server at the same time. By default, the first notebook server starts on port 8888 and later notebook servers search for open ports near that one.\n",
46 "You can start more than one notebook server at the same time. By default, the first notebook server starts on port 8888 and later notebook servers search for open ports near that one.\n",
47 "\n",
47 "\n",
48 "You can also specify the port manually:\n",
48 "You can also specify the port manually:\n",
49 "\n",
49 "\n",
50 " ipython notebook --port 9999\n",
50 " ipython notebook --port 9999\n",
51 "\n",
51 "\n",
52 "Or start notebook server without opening a web browser.\n",
52 "Or start notebook server without opening a web browser.\n",
53 "\n",
53 "\n",
54 " ipython notebook --no-browser\n",
54 " ipython notebook --no-browser\n",
55 "\n",
55 "\n",
56 "The notebook server has a number of other command line arguments that can be displayed with the `--help` flag: \n",
56 "The notebook server has a number of other command line arguments that can be displayed with the `--help` flag: \n",
57 "\n",
57 "\n",
58 " ipython notebook --help\n",
58 " ipython notebook --help\n",
59 "\n",
59 "\n",
60 "<div class=\"alert alert-failure\">\n",
60 "<div class=\"alert alert-failure\">\n",
61 "It used to be possible to specify kernel options, such as <code>--pylab inline</code> from the command line. This is deprecated in IPython 2.0 and will be removed in IPython 3.0. To enable matplotlib based plotting for the Python kernel use the <code>%matplotlib</code> magic command.\n",
61 "It used to be possible to specify kernel options, such as <code>--pylab inline</code> from the command line. This is deprecated in IPython 2.0 and will be removed in IPython 3.0. To enable matplotlib based plotting for the Python kernel use the <code>%matplotlib</code> magic command.\n",
62 "</div>\n",
62 "</div>\n",
63 "\n"
63 "\n"
64 ]
64 ]
65 },
65 },
66 {
66 {
67 "cell_type": "heading",
67 "cell_type": "heading",
68 "level": 2,
68 "level": 2,
69 "metadata": {},
69 "metadata": {},
70 "source": [
70 "source": [
71 "Configuring the IPython Notebook"
71 "Configuring the IPython Notebook"
72 ]
72 ]
73 },
73 },
74 {
74 {
75 "cell_type": "markdown",
75 "cell_type": "markdown",
76 "metadata": {},
76 "metadata": {},
77 "source": [
77 "source": [
78 "The notebook web server can also be configured using IPython profiles and configuration files. The Notebook web server configuration options are set in a file named `ipython_notebook_config.py` in your IPython *profile directory*. The profile directory is a subfolder of your IPython directory, which itself is usually `.ipython` in your home directory.\n",
78 "The notebook web server can also be configured using IPython profiles and configuration files. The Notebook web server configuration options are set in a file named `ipython_notebook_config.py` in your IPython *profile directory*. The profile directory is a subfolder of your IPython directory, which itself is usually `.ipython` in your home directory.\n",
79 "\n",
79 "\n",
80 "You can display the location of your default profile directory by running the command:\n",
80 "You can display the location of your default profile directory by running the command:"
81 "\n",
81 ]
82 " ipython locate\n",
82 },
83 "\n",
83 {
84 "cell_type": "code",
85 "collapsed": false,
86 "input": [
87 "!ipython profile locate default"
88 ],
89 "language": "python",
90 "metadata": {},
91 "outputs": [
92 {
93 "output_type": "stream",
94 "stream": "stdout",
95 "text": [
96 "/Users/bgranger/.ipython/profile_default\r\n"
97 ]
98 }
99 ],
100 "prompt_number": 7
101 },
102 {
103 "cell_type": "markdown",
104 "metadata": {},
105 "source": [
84 "The default version of `ipython_notebook_config.py` lists all of the options available along with documentation for each. Changes made to that file will affect all notebook servers run under that profile. Command line options always override those set in configuration files.\n",
106 "The default version of `ipython_notebook_config.py` lists all of the options available along with documentation for each. Changes made to that file will affect all notebook servers run under that profile. Command line options always override those set in configuration files.\n",
85 "\n",
107 "\n",
108 "You can create a new profile:"
109 ]
110 },
111 {
112 "cell_type": "code",
113 "collapsed": false,
114 "input": [
115 "!ipython profile create my_profile"
116 ],
117 "language": "python",
118 "metadata": {},
119 "outputs": [
120 {
121 "output_type": "stream",
122 "stream": "stdout",
123 "text": [
124 "[ProfileCreate] Generating default config file: u'/Users/bgranger/.ipython/profile_my_profile/ipython_config.py'\r\n"
125 ]
126 },
127 {
128 "output_type": "stream",
129 "stream": "stdout",
130 "text": [
131 "[ProfileCreate] Generating default config file: u'/Users/bgranger/.ipython/profile_my_profile/ipython_qtconsole_config.py'\r\n"
132 ]
133 },
134 {
135 "output_type": "stream",
136 "stream": "stdout",
137 "text": [
138 "[ProfileCreate] Generating default config file: u'/Users/bgranger/.ipython/profile_my_profile/ipython_notebook_config.py'\r\n",
139 "[ProfileCreate] Generating default config file: u'/Users/bgranger/.ipython/profile_my_profile/ipython_nbconvert_config.py'\r\n"
140 ]
141 }
142 ],
143 "prompt_number": 3
144 },
145 {
146 "cell_type": "markdown",
147 "metadata": {},
148 "source": [
149 "And then view its location:"
150 ]
151 },
152 {
153 "cell_type": "code",
154 "collapsed": false,
155 "input": [
156 "!ipython profile locate my_profile"
157 ],
158 "language": "python",
159 "metadata": {},
160 "outputs": [
161 {
162 "output_type": "stream",
163 "stream": "stdout",
164 "text": [
165 "/Users/bgranger/.ipython/profile_my_profile\r\n"
166 ]
167 }
168 ],
169 "prompt_number": 5
170 },
171 {
172 "cell_type": "markdown",
173 "metadata": {},
174 "source": [
175 "To start the notebook server using a given profile, run the following:\n",
176 "\n",
177 " ipython notebook --profile=my_profile"
178 ]
179 },
180 {
181 "cell_type": "markdown",
182 "metadata": {},
183 "source": [
86 "More details about IPython configuration files and profiles can be found [here](http://ipython.org/ipython-doc/dev/config/intro.html)."
184 "More details about IPython configuration files and profiles can be found [here](http://ipython.org/ipython-doc/dev/config/intro.html)."
87 ]
185 ]
88 },
186 },
89 {
187 {
90 "cell_type": "heading",
188 "cell_type": "heading",
91 "level": 2,
189 "level": 2,
92 "metadata": {},
190 "metadata": {},
93 "source": [
191 "source": [
94 "Securing the notebook server"
192 "Securing the notebook server"
95 ]
193 ]
96 },
194 },
97 {
195 {
98 "cell_type": "markdown",
196 "cell_type": "markdown",
99 "metadata": {},
197 "metadata": {},
100 "source": [
198 "source": [
101 "The IPython Notebook allows arbitrary code execution on the computer running it. Thus, the notebook web server should never be run on the open internet without first securing it. By default, the notebook server only listens on local network interface (`127.0.0.1`) There are two steps required to secure the notebook server:\n",
199 "The IPython Notebook allows arbitrary code execution on the computer running it. Thus, the notebook web server should never be run on the open internet without first securing it. By default, the notebook server only listens on local network interface (`127.0.0.1`) There are two steps required to secure the notebook server:\n",
102 "\n",
200 "\n",
103 "1. Setting a password\n",
201 "1. Setting a password\n",
104 "2. Encrypt network traffic using SSL\n",
202 "2. Encrypt network traffic using SSL"
105 "\n",
203 ]
106 "\n",
204 },
107 "\n",
205 {
108 "You can protect your notebook server with a simple single password by setting the `NotebookApp.password` configurable. You can prepare a hashed password using the function `IPython.lib.security.passwd`:\n",
206 "cell_type": "heading",
109 "\n",
207 "level": 3,
110 "```python\n",
208 "metadata": {},
111 "In [1]: from IPython.lib import passwd\n",
209 "source": [
112 "In [2]: passwd()\n",
210 "Setting a password"
113 "Enter password: \n",
211 ]
114 "Verify password: \n",
212 },
115 "Out[2]: 'sha1:67c9e60bb8b6:9ffede0825894254b2e042ea597d771089e11aed'\n",
213 {
116 "```\n",
214 "cell_type": "markdown",
117 "\n",
215 "metadata": {},
118 "<div class=\"alert alert-warn\">\n",
216 "source": [
119 "`IPython.lib.security.passwd` can also take the password as a string argument. **Do not** pass it as an argument inside an IPython session, as it will be saved in your input history.\n",
217 "You can protect your notebook server with a simple single password by setting the `NotebookApp.password` configurable. You can prepare a hashed password using the function `IPython.lib.passwd`:"
120 "</div>\n",
218 ]
121 "\n",
219 },
220 {
221 "cell_type": "code",
222 "collapsed": false,
223 "input": [
224 "from IPython.lib import passwd\n",
225 "password = passwd(\"secret\")\n",
226 "password"
227 ],
228 "language": "python",
229 "metadata": {},
230 "outputs": [
231 {
232 "metadata": {},
233 "output_type": "pyout",
234 "prompt_number": 1,
235 "text": [
236 "'sha1:6c2164fc2b22:ed55ecf07fc0f985ab46561483c0e888e8964ae6'"
237 ]
238 }
239 ],
240 "prompt_number": 1
241 },
242 {
243 "cell_type": "markdown",
244 "metadata": {},
245 "source": [
122 "You can then add this to your `ipython_notebook_config.py`:\n",
246 "You can then add this to your `ipython_notebook_config.py`:\n",
123 "\n",
247 "\n",
124 "```python\n",
248 "```python\n",
125 "# Password to use for web authentication\n",
249 "# Password to use for web authentication\n",
126 "c = get_config()\n",
250 "c = get_config()\n",
127 "c.NotebookApp.password = \n",
251 "c.NotebookApp.password = \n",
128 "u'sha1:67c9e60bb8b6:9ffede0825894254b2e042ea597d771089e11aed'\n",
252 "u'sha1:6c2164fc2b22:ed55ecf07fc0f985ab46561483c0e888e8964ae6'\n",
129 "```\n",
253 "```"
130 "When using a password, it is a good idea to also use SSL, so that your \n",
254 ]
131 "password is not sent unencrypted by your browser. You can start the notebook \n",
255 },
132 "to communicate via a secure protocol mode using a self-signed certificate with \n",
256 {
133 "the command::\n",
257 "cell_type": "heading",
134 "\n",
258 "level": 3,
135 " $ ipython notebook --certfile=mycert.pem\n",
259 "metadata": {},
136 "\n",
260 "source": [
137 ".. note::\n",
261 "Using SSL/HTTPS"
138 "\n",
139 " A self-signed certificate can be generated with ``openssl``. For example, \n",
140 " the following command will create a certificate valid for 365 days with \n",
141 " both the key and certificate data written to the same file::\n",
142 "\n",
143 " $ openssl req -x509 -nodes -days 365 -newkey rsa:1024 -keyout mycert.pem -out mycert.pem\n",
144 "\n",
145 "Your browser will warn you of a dangerous certificate because it is\n",
146 "self-signed. If you want to have a fully compliant certificate that will not\n",
147 "raise warnings, it is possible (but rather involved) to obtain one,\n",
148 "as explained in detail in `this tutorial`__.\n",
149 "\n",
150 ".. __: http://arstechnica.com/security/news/2009/12/how-to-get-set-with-a-secure-sertificate-for-free.ars\n",
151 "\t\n",
152 "Keep in mind that when you enable SSL support, you will need to access the\n",
153 "notebook server over ``https://``, not over plain ``http://``. The startup\n",
154 "message from the server prints this, but it is easy to overlook and think the\n",
155 "server is for some reason non-responsive."
156 ]
262 ]
157 },
263 },
158 {
264 {
159 "cell_type": "markdown",
265 "cell_type": "markdown",
160 "metadata": {},
266 "metadata": {},
161 "source": [
267 "source": [
162 "Running a public notebook server\n",
268 "When using a password, it is a good idea to also use SSL, so that your \n",
163 "--------------------------------\n",
269 "password is not sent unencrypted by your browser to the web server. When running the notebook on the public internet this is absolutely required.\n",
164 "\n",
270 "\n",
165 "If you want to access your notebook server remotely via a web browser,\n",
271 "The first step is to generate an SSL certificate. A self-signed certificate can be generated with ``openssl``. For example, the following command will create a certificate valid for 365 days with both the key and certificate data written to the same file:\n",
166 "you can do the following. \n",
167 "\n",
272 "\n",
168 "Start by creating a certificate file and a hashed password, as explained \n",
273 " openssl req -x509 -nodes -days 365 -newkey rsa:1024 -keyout mycert.pem -out mycert.pem\n",
169 "above. Then create a custom profile for the notebook, with the following \n",
170 "command line, type::\n",
171 "\n",
274 "\n",
172 " $ ipython profile create nbserver\n",
275 "In most cases, you should run this command in your profile directory, which will make it easy to use the generated key and certificate.\n",
173 "\n",
276 "\n",
174 "In the profile directory just created, edit the file \n",
277 "When you connect to a notebook server over HTTPS using a self-signed certificate, your browser will warn you of a dangerous certificate because it is self-signed. If you want to have a fully compliant certificate that will not raise warnings, it is possible (but rather involved) to obtain one,\n",
175 "``ipython_notebook_config.py``. By default, the file has all fields \n",
278 "as explained in detail in [this tutorial](http://arstechnica.com/security/news/2009/12/how-to-get-set-with-a-secure-sertificate-for-free.ars)\n",
176 "commented; the minimum set you need to uncomment and edit is the following::\n",
279 "\t\n",
280 "When you enable SSL support, you will need to access the notebook server over ``https://``, rather than plain ``http://``. The startup message from the notebook server prints the correct URL, but it is easy to overlook and think the server is for some reason non-responsive.\n",
177 "\n",
281 "\n",
178 " c = get_config()\n",
282 "Once you have generated the key and certificate, you can configure the notebook server to use them, by adding the following to `ipython_notebook_config.py`:\n",
179 "\n",
283 "\n",
180 " # Kernel config\n",
284 "```python\n",
181 " c.IPKernelApp.pylab = 'inline' # if you want plotting support always\n",
285 "# The full path to an SSL/TLS certificate file.\n",
286 "c.NotebookApp.certfile = u'/Users/bgranger/.ipython/profile_my_profile/mycert.crt'\n",
182 "\n",
287 "\n",
183 " # Notebook config\n",
288 "# The full path to a private key file for usage with SSL/TLS.\n",
184 " c.NotebookApp.certfile = u'/absolute/path/to/your/certificate/mycert.pem'\n",
289 "c.NotebookApp.keyfile = u'/Users/bgranger/.ipython/profile_my_profile/mycert.key'\n",
185 " c.NotebookApp.ip = '*'\n",
290 "```"
186 " c.NotebookApp.open_browser = False\n",
291 ]
187 " c.NotebookApp.password = u'sha1:bcd259ccf...[your hashed password here]'\n",
292 },
188 " # It is a good idea to put it on a known, fixed port\n",
293 {
189 " c.NotebookApp.port = 9999\n",
294 "cell_type": "heading",
295 "level": 2,
296 "metadata": {},
297 "source": [
298 "Running a public notebook server"
299 ]
300 },
301 {
302 "cell_type": "markdown",
303 "metadata": {},
304 "source": [
305 "<div class=\"alert alert-error\">\n",
306 "Don't run a public notebook server unless you first secure it with a password and SSL/HTTPS as described above\n",
307 "</div>\n",
190 "\n",
308 "\n",
191 "You can then start the notebook and access it later by pointing your browser \n",
309 "By default the notebook server only listens on the `localhost/127.0.0.1` network interface. If you want to connect to the notebook from another computers, or over the internet, you need to configure the notebook server to listen on all network interfaces and not open the browser. You will often also want to disable the automatic launching of the web browser.\n",
192 "to ``https://your.host.com:9999`` with ``ipython notebook \n",
193 "--profile=nbserver``.\n",
194 "\n",
310 "\n",
195 "Running with a different URL prefix\n",
311 "This can be accomplished by passing a command line options.\n",
196 "-----------------------------------\n",
197 "\n",
312 "\n",
198 "The notebook dashboard (the landing page with an overview\n",
313 " ipython notebook --ip=* --no-browser\n",
199 "of the notebooks in your working directory) typically lives at the URL\n",
200 "``http://localhost:8888/``. If you prefer that it lives, together with the \n",
201 "rest of the notebook, under a sub-directory,\n",
202 "e.g. ``http://localhost:8888/ipython/``, you can do so with\n",
203 "configuration options like the following (see above for instructions about\n",
204 "modifying ``ipython_notebook_config.py``)::\n",
205 "\n",
314 "\n",
206 " c.NotebookApp.base_url = '/ipython/'\n",
315 "You can also add the following to your`ipython_notebook_config.py` file:\n",
207 " c.NotebookApp.webapp_settings = {'static_url_prefix':'/ipython/static/'}\n",
208 "\n",
316 "\n",
209 "Using a different notebook store\n",
317 "```python\n",
210 "--------------------------------\n",
318 "c.NotebookApp.ip = '*'\n",
319 "c.NotebookApp.open_browser = False\n",
320 "```"
321 ]
322 },
323 {
324 "cell_type": "heading",
325 "level": 2,
326 "metadata": {},
327 "source": [
328 "Running with a different URL prefix"
329 ]
330 },
331 {
332 "cell_type": "markdown",
333 "metadata": {},
334 "source": [
335 "The notebook dashboard typically lives at the URL `http://localhost:8888/tree`. If you prefer that it lives, together with the \n",
336 "rest of the notebook web application, under a base URL prefix, such as `http://localhost:8888/ipython/tree`, you can do so by adding the following lines to your `ipython_notebook_config.py` file.\n",
211 "\n",
337 "\n",
212 "By default, the notebook server stores the notebook documents that it saves as \n",
338 "```python\n",
213 "files in the working directory of the notebook server, also known as the\n",
339 "c.NotebookApp.base_url = '/ipython/'\n",
214 "``notebook_dir``. This logic is implemented in the \n",
340 "c.NotebookApp.webapp_settings = {'static_url_prefix':'/ipython/static/'}\n",
215 ":class:`FileNotebookManager` class. However, the server can be configured to \n",
341 "```"
216 "use a different notebook manager class, which can \n",
342 ]
217 "store the notebooks in a different format. \n",
343 },
344 {
345 "cell_type": "heading",
346 "level": 2,
347 "metadata": {},
348 "source": [
349 "Using a different notebook store"
350 ]
351 },
352 {
353 "cell_type": "markdown",
354 "metadata": {},
355 "source": [
356 "By default, the notebook server stores the notebook documents that it saves as files in the working directory of the notebook server, also known as the\n",
357 "`notebook_dir`. This logic is implemented in the `FileNotebookManager` class. However, the server can be configured to use a different notebook manager class, which can store the notebooks in a different format. \n",
218 "\n",
358 "\n",
219 "The bookstore_ package currently allows users to store notebooks on Rackspace\n",
359 "The [bookstore](https://github.com/rgbkrk/bookstore) package currently allows users to store notebooks on Rackspace CloudFiles or OpenStack Swift based object stores.\n",
220 "CloudFiles or OpenStack Swift based object stores.\n",
221 "\n",
360 "\n",
222 "Writing a notebook manager is as simple as extending the base class\n",
361 "Writing a notebook manager is as simple as extending the base class `NotebookManager`. The [simple_notebook_manager](https://github.com/khinsen/simple_notebook_manager) provides a great example\n",
223 ":class:`NotebookManager`. The simple_notebook_manager_ provides a great example\n",
224 "of an in memory notebook manager, created solely for the purpose of\n",
362 "of an in memory notebook manager, created solely for the purpose of\n",
225 "illustrating the notebook manager API.\n",
363 "illustrating the notebook manager API."
226 "\n",
364 ]
227 ".. _bookstore: https://github.com/rgbkrk/bookstore\n",
365 },
228 "\n",
366 {
229 ".. _simple_notebook_manager: https://github.com/khinsen/simple_notebook_manager\n",
367 "cell_type": "heading",
230 "\n",
368 "level": 2,
231 "Known issues\n",
369 "metadata": {},
232 "------------\n",
370 "source": [
233 "\n",
371 "Known issues"
234 "When behind a proxy, especially if your system or browser is set to autodetect\n",
372 ]
235 "the proxy, the notebook web application might fail to connect to the server's\n",
373 },
236 "websockets, and present you with a warning at startup. In this case, you need\n",
374 {
237 "to configure your system not to use the proxy for the server's address.\n",
375 "cell_type": "markdown",
376 "metadata": {},
377 "source": [
378 "When behind a proxy, especially if your system or browser is set to autodetect the proxy, the notebook web application might fail to connect to the server's websockets, and present you with a warning at startup. In this case, you need to configure your system not to use the proxy for the server's address.\n",
238 "\n",
379 "\n",
239 "For example, in Firefox, go to the Preferences panel, Advanced section,\n",
380 "For example, in Firefox, go to the Preferences panel, Advanced section,\n",
240 "Network tab, click 'Settings...', and add the address of the notebook server\n",
381 "Network tab, click 'Settings...', and add the address of the notebook server\n",
241 "to the 'No proxy for' field."
382 "to the 'No proxy for' field."
242 ]
383 ]
243 }
384 }
244 ],
385 ],
245 "metadata": {}
386 "metadata": {}
246 }
387 }
247 ]
388 ]
248 } No newline at end of file
389 }
@@ -1,467 +1,171 b''
1 {
1 {
2 "metadata": {
2 "metadata": {
3 "name": "",
3 "name": "",
4 "signature": "sha256:a52ac3735e5881fe8fe68f88d0113c3b1dca40cb809955db692fedb89b66a7fa"
4 "signature": "sha256:1cf51b66a39fb370f2fb3d08af95cfc79b8884f310509181b3b0586400e20b81"
5 },
5 },
6 "nbformat": 3,
6 "nbformat": 3,
7 "nbformat_minor": 0,
7 "nbformat_minor": 0,
8 "worksheets": [
8 "worksheets": [
9 {
9 {
10 "cells": [
10 "cells": [
11 {
11 {
12 "cell_type": "heading",
12 "cell_type": "heading",
13 "level": 1,
13 "level": 1,
14 "metadata": {},
14 "metadata": {},
15 "source": [
15 "source": [
16 "Running Code in the IPython Notebook"
16 "Running Code in the IPython Notebook"
17 ]
17 ]
18 },
18 },
19 {
19 {
20 "cell_type": "markdown",
20 "cell_type": "markdown",
21 "metadata": {},
21 "metadata": {},
22 "source": [
22 "source": [
23 "First and foremost, the IPython Notebook is an interactive environment for writing and running Python code."
23 "First and foremost, the IPython Notebook is an interactive environment for writing and running code. IPython is capable of running code in a wide range of languages. However, in IPython 2.0, the default kernel runs Python code."
24 ]
24 ]
25 },
25 },
26 {
26 {
27 "cell_type": "heading",
27 "cell_type": "heading",
28 "level": 2,
28 "level": 2,
29 "metadata": {},
29 "metadata": {},
30 "source": [
30 "source": [
31 "Code cells allow you to enter and run Python code"
31 "Code cells allow you to enter and run Python code"
32 ]
32 ]
33 },
33 },
34 {
34 {
35 "cell_type": "markdown",
35 "cell_type": "markdown",
36 "metadata": {},
36 "metadata": {},
37 "source": [
37 "source": [
38 "\n",
38 "Run a code cell using `Shift-Enter` or pressing the <button><i class=\"icon-play fa fa-play\"></i></button> button in the toolbar above:"
39 "<script type=\"text/javascript\">\n",
40 "var _toggle=false;\n",
41 "var hl = function (id, on){\n",
42 " $(id)[0].style.background = '';\n",
43 " if (on) {\n",
44 " $(id)[0].style.background = 'lightcyan';\n",
45 " }\n",
46 "};\n",
47 "</script>\n",
48 "\n",
49 "Run a code cell using `shift-enter` or pressing the <button class='btn btn-default btn-xs'><i class=\"icon-play fa fa-play\"></i></button> button in the <a href=\"#\" onMouseover=\"hl('#maintoolbar-container', 1)\" onMouseout=\"hl('#maintoolbar-container', 0)\">toolbar</a> above:"
50 ]
39 ]
51 },
40 },
52 {
41 {
53 "cell_type": "code",
42 "cell_type": "code",
54 "collapsed": false,
43 "collapsed": false,
55 "input": [
44 "input": [
56 "a = 10"
45 "a = 10"
57 ],
46 ],
58 "language": "python",
47 "language": "python",
59 "metadata": {},
48 "metadata": {},
60 "outputs": [],
49 "outputs": [],
61 "prompt_number": 1
50 "prompt_number": 1
62 },
51 },
63 {
52 {
64 "cell_type": "code",
53 "cell_type": "code",
65 "collapsed": false,
54 "collapsed": false,
66 "input": [
55 "input": [
67 "print(a)"
56 "print(a)"
68 ],
57 ],
69 "language": "python",
58 "language": "python",
70 "metadata": {},
59 "metadata": {},
71 "outputs": [
60 "outputs": [
72 {
61 {
73 "output_type": "stream",
62 "output_type": "stream",
74 "stream": "stdout",
63 "stream": "stdout",
75 "text": [
64 "text": [
76 "10\n"
65 "10\n"
77 ]
66 ]
78 }
67 }
79 ],
68 ],
80 "prompt_number": 2
69 "prompt_number": 2
81 },
70 },
82 {
71 {
72 "cell_type": "markdown",
73 "metadata": {},
74 "source": [
75 "There are two other keyboard shortcuts for running code:\n",
76 "\n",
77 "* `Alt-Enter` runs the current cell and inserts a new one below.\n",
78 "* `Ctrl-Enter` run the current cell and enters command mode."
79 ]
80 },
81 {
83 "cell_type": "heading",
82 "cell_type": "heading",
84 "level": 2,
83 "level": 2,
85 "metadata": {},
84 "metadata": {},
86 "source": [
85 "source": [
87 "Managing the IPython Kernel"
86 "Managing the IPython Kernel"
88 ]
87 ]
89 },
88 },
90 {
89 {
91 "cell_type": "markdown",
90 "cell_type": "markdown",
92 "metadata": {},
91 "metadata": {},
93 "source": [
92 "source": [
94 "Code is run in a separate process called the IPython Kernel. The Kernel can be interrupted or restarted. Try running the following cell and then hit the <button class='btn btn-default btn-xs'><i class='icon-stop fa fa-stop'></i></button> button in the <a href=\"#\" onMouseover=\"hl('#maintoolbar-container', 1)\" onMouseout=\"hl('#maintoolbar-container', 0)\">toolbar</a> above."
93 "Code is run in a separate process called the IPython Kernel. The Kernel can be interrupted or restarted. Try running the following cell and then hit the <button><i class='icon-stop fa fa-stop'></i></button> button in the toolbar above."
95 ]
94 ]
96 },
95 },
97 {
96 {
98 "cell_type": "code",
97 "cell_type": "code",
99 "collapsed": false,
98 "collapsed": false,
100 "input": [
99 "input": [
101 "import time\n",
100 "import time\n",
102 "time.sleep(10)"
101 "time.sleep(10)"
103 ],
102 ],
104 "language": "python",
103 "language": "python",
105 "metadata": {},
104 "metadata": {},
106 "outputs": []
105 "outputs": []
107 },
106 },
108 {
107 {
109 "cell_type": "markdown",
108 "cell_type": "markdown",
110 "metadata": {},
109 "metadata": {},
111 "source": [
110 "source": [
112 "If the Kernel dies you will be prompted to restart it. Here we call the low-level system libc.time routine with the wrong argument via\n",
111 "If the Kernel dies you will be prompted to restart it. Here we call the low-level system libc.time routine with the wrong argument via\n",
113 "ctypes to segfault the Python interpreter:"
112 "ctypes to segfault the Python interpreter:"
114 ]
113 ]
115 },
114 },
116 {
115 {
117 "cell_type": "code",
116 "cell_type": "code",
118 "collapsed": false,
117 "collapsed": false,
119 "input": [
118 "input": [
120 "import sys\n",
119 "import sys\n",
121 "from ctypes import CDLL\n",
120 "from ctypes import CDLL\n",
122 "# This will crash a Linux or Mac system; equivalent calls can be made on Windows\n",
121 "# This will crash a Linux or Mac system\n",
122 "# equivalent calls can be made on Windows\n",
123 "dll = 'dylib' if sys.platform == 'darwin' else 'so.6'\n",
123 "dll = 'dylib' if sys.platform == 'darwin' else 'so.6'\n",
124 "libc = CDLL(\"libc.%s\" % dll) \n",
124 "libc = CDLL(\"libc.%s\" % dll) \n",
125 "libc.time(-1) # BOOM!!"
125 "libc.time(-1) # BOOM!!"
126 ],
126 ],
127 "language": "python",
127 "language": "python",
128 "metadata": {},
128 "metadata": {},
129 "outputs": []
129 "outputs": []
130 },
130 },
131 {
131 {
132 "cell_type": "heading",
132 "cell_type": "heading",
133 "level": 2,
133 "level": 2,
134 "metadata": {},
134 "metadata": {},
135 "source": [
135 "source": [
136 "All of the goodness of IPython works"
136 "Cell menu"
137 ]
138 },
139 {
140 "cell_type": "markdown",
141 "metadata": {},
142 "source": [
143 "Here are two system aliases:"
144 ]
145 },
146 {
147 "cell_type": "code",
148 "collapsed": false,
149 "input": [
150 "pwd"
151 ],
152 "language": "python",
153 "metadata": {},
154 "outputs": [
155 {
156 "metadata": {},
157 "output_type": "pyout",
158 "prompt_number": 1,
159 "text": [
160 "u'/Users/bgranger/Documents/Computing/IPython/code/ipython/examples/Notebook/Tutorials'"
161 ]
162 }
163 ],
164 "prompt_number": 1
165 },
166 {
167 "cell_type": "code",
168 "collapsed": false,
169 "input": [
170 "ls"
171 ],
172 "language": "python",
173 "metadata": {},
174 "outputs": [
175 {
176 "output_type": "stream",
177 "stream": "stdout",
178 "text": [
179 "Basic Output.ipynb Plotting with Matplotlib.ipynb data.csv\r\n",
180 "Custom Display Logic.ipynb Running Code.ipynb \u001b[34mimages\u001b[m\u001b[m/\r\n",
181 "Display System.ipynb Typesetting Math Using MathJax.ipynb\r\n",
182 "Markdown Cells.ipynb User Interface.ipynb\r\n"
183 ]
184 }
185 ],
186 "prompt_number": 2
187 },
188 {
189 "cell_type": "markdown",
190 "metadata": {},
191 "source": [
192 "Any command line program can be run using `!` with string interpolation from Python variables:"
193 ]
194 },
195 {
196 "cell_type": "code",
197 "collapsed": false,
198 "input": [
199 "message = 'The IPython notebook is great!'\n",
200 "# note: the echo command does not run on Windows, it's a unix command.\n",
201 "!echo $message"
202 ],
203 "language": "python",
204 "metadata": {},
205 "outputs": [
206 {
207 "output_type": "stream",
208 "stream": "stdout",
209 "text": [
210 "The IPython notebook is great!\r\n"
211 ]
212 }
213 ],
214 "prompt_number": 3
215 },
216 {
217 "cell_type": "markdown",
218 "metadata": {},
219 "source": [
220 "Tab completion works:"
221 ]
137 ]
222 },
138 },
223 {
139 {
224 "cell_type": "code",
225 "collapsed": false,
226 "input": [
227 "import numpy"
228 ],
229 "language": "python",
230 "metadata": {},
231 "outputs": [],
232 "prompt_number": 5
233 },
234 {
235 "cell_type": "code",
236 "collapsed": false,
237 "input": [
238 "numpy.random."
239 ],
240 "language": "python",
241 "metadata": {},
242 "outputs": []
243 },
244 {
245 "cell_type": "markdown",
140 "cell_type": "markdown",
246 "metadata": {},
141 "metadata": {},
247 "source": [
142 "source": [
248 "Shift-Tab on selection, or after `(` brings up a tooltip with the docstring:"
143 "The \"Cell\" menu has a number of menu items for running code in different ways. These includes:\n",
249 ]
144 "\n",
250 },
145 "* Run and Select Below\n",
251 {
146 "* Run and Insert Below\n",
252 "cell_type": "code",
147 "* Run All\n",
253 "collapsed": false,
148 "* Run All Above\n",
254 "input": [
149 "* Run All Below"
255 "numpy.random.rand("
256 ],
257 "language": "python",
258 "metadata": {},
259 "outputs": []
260 },
261 {
262 "cell_type": "markdown",
263 "metadata": {},
264 "source": [
265 "Adding `?` opens the docstring in the pager below:"
266 ]
267 },
268 {
269 "cell_type": "code",
270 "collapsed": false,
271 "input": [
272 "magic?"
273 ],
274 "language": "python",
275 "metadata": {},
276 "outputs": [],
277 "prompt_number": 8
278 },
279 {
280 "cell_type": "markdown",
281 "metadata": {},
282 "source": [
283 "Exceptions are formatted nicely:"
284 ]
150 ]
285 },
151 },
286 {
152 {
287 "cell_type": "code",
288 "collapsed": false,
289 "input": [
290 "x = 1\n",
291 "y = 4\n",
292 "z = y/(1-x)"
293 ],
294 "language": "python",
295 "metadata": {},
296 "outputs": [
297 {
298 "ename": "ZeroDivisionError",
299 "evalue": "integer division or modulo by zero",
300 "output_type": "pyerr",
301 "traceback": [
302 "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m\n\u001b[0;31mZeroDivisionError\u001b[0m Traceback (most recent call last)",
303 "\u001b[0;32m<ipython-input-6-dc39888fd1d2>\u001b[0m in \u001b[0;36m<module>\u001b[0;34m()\u001b[0m\n\u001b[1;32m 1\u001b[0m \u001b[0mx\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0;36m1\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 2\u001b[0m \u001b[0my\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0;36m4\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m----> 3\u001b[0;31m \u001b[0mz\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0my\u001b[0m\u001b[0;34m/\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;36m1\u001b[0m\u001b[0;34m-\u001b[0m\u001b[0mx\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m",
304 "\u001b[0;31mZeroDivisionError\u001b[0m: integer division or modulo by zero"
305 ]
306 }
307 ],
308 "prompt_number": 6
309 },
310 {
311 "cell_type": "heading",
153 "cell_type": "heading",
312 "level": 2,
154 "level": 2,
313 "metadata": {},
155 "metadata": {},
314 "source": [
156 "source": [
315 "Working with external code"
157 "Restarting the kernels"
316 ]
158 ]
317 },
159 },
318 {
160 {
319 "cell_type": "markdown",
161 "cell_type": "markdown",
320 "metadata": {},
162 "metadata": {},
321 "source": [
163 "source": [
322 "There are a number of ways of getting external code into code cells."
164 "The kernel maintains the state of a notebook's computations. You can reset this state by restarting the kernel. This is done by clicking on the <button><i class='icon-repeat'></i></button> in the toolbar above."
323 ]
324 },
325 {
326 "cell_type": "markdown",
327 "metadata": {},
328 "source": [
329 "Pasting code with `>>>` prompts works as expected:"
330 ]
331 },
332 {
333 "cell_type": "code",
334 "collapsed": false,
335 "input": [
336 ">>> the_world_is_flat = 1\n",
337 ">>> if the_world_is_flat:\n",
338 "... print(\"Be careful not to fall off!\")"
339 ],
340 "language": "python",
341 "metadata": {},
342 "outputs": [
343 {
344 "output_type": "stream",
345 "stream": "stdout",
346 "text": [
347 "Be careful not to fall off!\n"
348 ]
349 }
350 ],
351 "prompt_number": 7
352 },
353 {
354 "cell_type": "markdown",
355 "metadata": {},
356 "source": [
357 "The `%load` magic lets you load code from URLs or local files:"
358 ]
165 ]
359 },
360 {
361 "cell_type": "code",
362 "collapsed": false,
363 "input": [
364 "%load?"
365 ],
366 "language": "python",
367 "metadata": {},
368 "outputs": [],
369 "prompt_number": 8
370 },
371 {
372 "cell_type": "code",
373 "collapsed": false,
374 "input": [
375 "%matplotlib inline"
376 ],
377 "language": "python",
378 "metadata": {},
379 "outputs": [],
380 "prompt_number": 9
381 },
382 {
383 "cell_type": "code",
384 "collapsed": false,
385 "input": [
386 "%load http://matplotlib.org/mpl_examples/showcase/integral_demo.py"
387 ],
388 "language": "python",
389 "metadata": {},
390 "outputs": [],
391 "prompt_number": 10
392 },
393 {
394 "cell_type": "code",
395 "collapsed": false,
396 "input": [
397 "\"\"\"\n",
398 "Plot demonstrating the integral as the area under a curve.\n",
399 "\n",
400 "Although this is a simple example, it demonstrates some important tweaks:\n",
401 "\n",
402 " * A simple line plot with custom color and line width.\n",
403 " * A shaded region created using a Polygon patch.\n",
404 " * A text label with mathtext rendering.\n",
405 " * figtext calls to label the x- and y-axes.\n",
406 " * Use of axis spines to hide the top and right spines.\n",
407 " * Custom tick placement and labels.\n",
408 "\"\"\"\n",
409 "import numpy as np\n",
410 "import matplotlib.pyplot as plt\n",
411 "from matplotlib.patches import Polygon\n",
412 "\n",
413 "\n",
414 "def func(x):\n",
415 " return (x - 3) * (x - 5) * (x - 7) + 85\n",
416 "\n",
417 "\n",
418 "a, b = 2, 9 # integral limits\n",
419 "x = np.linspace(0, 10)\n",
420 "y = func(x)\n",
421 "\n",
422 "fig, ax = plt.subplots()\n",
423 "plt.plot(x, y, 'r', linewidth=2)\n",
424 "plt.ylim(ymin=0)\n",
425 "\n",
426 "# Make the shaded region\n",
427 "ix = np.linspace(a, b)\n",
428 "iy = func(ix)\n",
429 "verts = [(a, 0)] + list(zip(ix, iy)) + [(b, 0)]\n",
430 "poly = Polygon(verts, facecolor='0.9', edgecolor='0.5')\n",
431 "ax.add_patch(poly)\n",
432 "\n",
433 "plt.text(0.5 * (a + b), 30, r\"$\\int_a^b f(x)\\mathrm{d}x$\",\n",
434 " horizontalalignment='center', fontsize=20)\n",
435 "\n",
436 "plt.figtext(0.9, 0.05, '$x$')\n",
437 "plt.figtext(0.1, 0.9, '$y$')\n",
438 "\n",
439 "ax.spines['right'].set_visible(False)\n",
440 "ax.spines['top'].set_visible(False)\n",
441 "ax.xaxis.set_ticks_position('bottom')\n",
442 "\n",
443 "ax.set_xticks((a, b))\n",
444 "ax.set_xticklabels(('$a$', '$b$'))\n",
445 "ax.set_yticks([])\n",
446 "\n",
447 "plt.show()\n"
448 ],
449 "language": "python",
450 "metadata": {},
451 "outputs": [
452 {
453 "metadata": {},
454 "output_type": "display_data",
455 "png": "iVBORw0KGgoAAAANSUhEUgAAAW8AAAEMCAYAAAALXDfgAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAIABJREFUeJzt3Xl4FFW+xvFvp9NJCAphkdUECAgqLigG2UZgrsB4YQZQ\nAZVFQQRxlAFFUQR1BMVxRAV0QMFxAUXUgRkXBrioiCJIhLAjO5KwG7ORpde6f5SJooGQpLuru/N+\nnqefFElXnR+QvBxOnTrHZhiGgYiIhJUoqwsQEZHyU3iLiIQhhbeISBhSeIuIhCGFt4hIGFJ4i4iE\nIYW3iEgYUniLiIShMsN727ZtTJ06lXXr1gFwxx13BLomEREpQ5nhXVBQgMPhwDAMdu7cyQUXXBCM\nukRE5CzKDO927dqxceNGOnTowLp16+jUqVMw6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301sbGxrF27\nlq5du9K1a1eqVat21nMU3iIiFktNTeWHH35g27ZtNGvWjC+//LLMczTmLSJisWXLllG/fn06derE\nkiVLqFu3bpnnaJ63iEgY0rCJiEgYUniLiIQhhbeISBhSeIuIhCGFt4hIGFJ4i4iEIYW3iEgYUniL\niISh/weZPyRnS1m/IAAAAABJRU5ErkJggg==\n",
456 "text": [
457 "<matplotlib.figure.Figure at 0x108604e50>"
458 ]
459 }
460 ],
461 "prompt_number": 11
462 }
166 }
463 ],
167 ],
464 "metadata": {}
168 "metadata": {}
465 }
169 }
466 ]
170 ]
467 } No newline at end of file
171 }
@@ -1,272 +1,319 b''
1 {
1 {
2 "metadata": {
2 "metadata": {
3 "name": "",
3 "name": "",
4 "signature": "sha256:056f083d2453c83c77ea0a659e9185084426263c9e42b4c0ccbb91c773d9503b"
4 "signature": "sha256:3b7cae0c0936f25e6ccb7acafe310c08a4162a1a7fd66fa9874a52cffa0f64f9"
5 },
5 },
6 "nbformat": 3,
6 "nbformat": 3,
7 "nbformat_minor": 0,
7 "nbformat_minor": 0,
8 "worksheets": [
8 "worksheets": [
9 {
9 {
10 "cells": [
10 "cells": [
11 {
11 {
12 "cell_type": "heading",
12 "cell_type": "heading",
13 "level": 1,
13 "level": 1,
14 "metadata": {},
14 "metadata": {},
15 "source": [
15 "source": [
16 "Markdown Cells"
16 "Markdown Cells"
17 ]
17 ]
18 },
18 },
19 {
19 {
20 "cell_type": "markdown",
20 "cell_type": "markdown",
21 "metadata": {},
21 "metadata": {},
22 "source": [
22 "source": [
23 "Text can be added to IPython Notebooks using Markdown cells. Markdown is a popular markup language that is a superset of HTML. Its specification can be found here:\n",
23 "Text can be added to IPython Notebooks using Markdown cells. Markdown is a popular markup language that is a superset of HTML. Its specification can be found here:\n",
24 "\n",
24 "\n",
25 "<http://daringfireball.net/projects/markdown/>"
25 "<http://daringfireball.net/projects/markdown/>"
26 ]
26 ]
27 },
27 },
28 {
28 {
29 "cell_type": "heading",
29 "cell_type": "heading",
30 "level": 2,
30 "level": 2,
31 "metadata": {},
31 "metadata": {},
32 "source": [
32 "source": [
33 "Markdown basics"
33 "Markdown basics"
34 ]
34 ]
35 },
35 },
36 {
36 {
37 "cell_type": "markdown",
37 "cell_type": "markdown",
38 "metadata": {},
38 "metadata": {},
39 "source": [
39 "source": [
40 "You can make text *italic* or **bold**."
40 "You can make text *italic* or **bold**."
41 ]
41 ]
42 },
42 },
43 {
43 {
44 "cell_type": "markdown",
44 "cell_type": "markdown",
45 "metadata": {},
45 "metadata": {},
46 "source": [
46 "source": [
47 "You can build nested itemized or enumerated lists:\n",
47 "You can build nested itemized or enumerated lists:\n",
48 "\n",
48 "\n",
49 "* One\n",
49 "* One\n",
50 " - Sublist\n",
50 " - Sublist\n",
51 " - This\n",
51 " - This\n",
52 " - Sublist\n",
52 " - Sublist\n",
53 " - That\n",
53 " - That\n",
54 " - The other thing\n",
54 " - The other thing\n",
55 "* Two\n",
55 "* Two\n",
56 " - Sublist\n",
56 " - Sublist\n",
57 "* Three\n",
57 "* Three\n",
58 " - Sublist\n",
58 " - Sublist\n",
59 "\n",
59 "\n",
60 "Now another list:\n",
60 "Now another list:\n",
61 "\n",
61 "\n",
62 "1. Here we go\n",
62 "1. Here we go\n",
63 " 1. Sublist\n",
63 " 1. Sublist\n",
64 " 2. Sublist\n",
64 " 2. Sublist\n",
65 "2. There we go\n",
65 "2. There we go\n",
66 "3. Now this"
66 "3. Now this"
67 ]
67 ]
68 },
68 },
69 {
69 {
70 "cell_type": "markdown",
70 "cell_type": "markdown",
71 "metadata": {},
71 "metadata": {},
72 "source": [
72 "source": [
73 "You can add horizontal rules:\n",
73 "You can add horizontal rules:\n",
74 "\n",
74 "\n",
75 "---"
75 "---"
76 ]
76 ]
77 },
77 },
78 {
78 {
79 "cell_type": "markdown",
79 "cell_type": "markdown",
80 "metadata": {},
80 "metadata": {},
81 "source": [
81 "source": [
82 "Here is a blockquote:\n",
82 "Here is a blockquote:\n",
83 "\n",
83 "\n",
84 "> Beautiful is better than ugly.\n",
84 "> Beautiful is better than ugly.\n",
85 "> Explicit is better than implicit.\n",
85 "> Explicit is better than implicit.\n",
86 "> Simple is better than complex.\n",
86 "> Simple is better than complex.\n",
87 "> Complex is better than complicated.\n",
87 "> Complex is better than complicated.\n",
88 "> Flat is better than nested.\n",
88 "> Flat is better than nested.\n",
89 "> Sparse is better than dense.\n",
89 "> Sparse is better than dense.\n",
90 "> Readability counts.\n",
90 "> Readability counts.\n",
91 "> Special cases aren't special enough to break the rules.\n",
91 "> Special cases aren't special enough to break the rules.\n",
92 "> Although practicality beats purity.\n",
92 "> Although practicality beats purity.\n",
93 "> Errors should never pass silently.\n",
93 "> Errors should never pass silently.\n",
94 "> Unless explicitly silenced.\n",
94 "> Unless explicitly silenced.\n",
95 "> In the face of ambiguity, refuse the temptation to guess.\n",
95 "> In the face of ambiguity, refuse the temptation to guess.\n",
96 "> There should be one-- and preferably only one --obvious way to do it.\n",
96 "> There should be one-- and preferably only one --obvious way to do it.\n",
97 "> Although that way may not be obvious at first unless you're Dutch.\n",
97 "> Although that way may not be obvious at first unless you're Dutch.\n",
98 "> Now is better than never.\n",
98 "> Now is better than never.\n",
99 "> Although never is often better than *right* now.\n",
99 "> Although never is often better than *right* now.\n",
100 "> If the implementation is hard to explain, it's a bad idea.\n",
100 "> If the implementation is hard to explain, it's a bad idea.\n",
101 "> If the implementation is easy to explain, it may be a good idea.\n",
101 "> If the implementation is easy to explain, it may be a good idea.\n",
102 "> Namespaces are one honking great idea -- let's do more of those!"
102 "> Namespaces are one honking great idea -- let's do more of those!"
103 ]
103 ]
104 },
104 },
105 {
105 {
106 "cell_type": "markdown",
106 "cell_type": "markdown",
107 "metadata": {},
107 "metadata": {},
108 "source": [
108 "source": [
109 "And shorthand for links:\n",
109 "And shorthand for links:\n",
110 "\n",
110 "\n",
111 "[IPython's website](http://ipython.org)"
111 "[IPython's website](http://ipython.org)"
112 ]
112 ]
113 },
113 },
114 {
114 {
115 "cell_type": "heading",
115 "cell_type": "heading",
116 "level": 2,
116 "level": 2,
117 "metadata": {},
117 "metadata": {},
118 "source": [
118 "source": [
119 "Headings"
119 "Headings"
120 ]
120 ]
121 },
121 },
122 {
122 {
123 "cell_type": "markdown",
123 "cell_type": "markdown",
124 "metadata": {},
124 "metadata": {},
125 "source": [
125 "source": [
126 "If you want, you can add headings using Markdown's syntax:\n",
126 "If you want, you can add headings using Markdown's syntax:\n",
127 "\n",
127 "\n",
128 "# Heading 1\n",
128 "# Heading 1\n",
129 "# Heading 2\n",
129 "# Heading 2\n",
130 "## Heading 2.1\n",
130 "## Heading 2.1\n",
131 "## Heading 2.2"
131 "## Heading 2.2"
132 ]
132 ]
133 },
133 },
134 {
134 {
135 "cell_type": "markdown",
135 "cell_type": "markdown",
136 "metadata": {},
136 "metadata": {},
137 "source": [
137 "source": [
138 "**BUT most of the time you should use the Notebook's Heading Cells to organize your Notebook content**, as they provide meaningful structure that can be interpreted by other tools, not just large bold fonts."
138 "**BUT most of the time you should use the Notebook's Heading Cells to organize your Notebook content**, as they provide meaningful structure that can be interpreted by other tools, not just large bold fonts."
139 ]
139 ]
140 },
140 },
141 {
141 {
142 "cell_type": "heading",
142 "cell_type": "heading",
143 "level": 2,
143 "level": 2,
144 "metadata": {},
144 "metadata": {},
145 "source": [
145 "source": [
146 "Embedded code"
146 "Embedded code"
147 ]
147 ]
148 },
148 },
149 {
149 {
150 "cell_type": "markdown",
150 "cell_type": "markdown",
151 "metadata": {},
151 "metadata": {},
152 "source": [
152 "source": [
153 "You can embed code meant for illustration instead of execution in Python:\n",
153 "You can embed code meant for illustration instead of execution in Python:\n",
154 "\n",
154 "\n",
155 " def f(x):\n",
155 " def f(x):\n",
156 " \"\"\"a docstring\"\"\"\n",
156 " \"\"\"a docstring\"\"\"\n",
157 " return x**2\n",
157 " return x**2\n",
158 "\n",
158 "\n",
159 "or other languages:\n",
159 "or other languages:\n",
160 "\n",
160 "\n",
161 " if (i=0; i<n; i++) {\n",
161 " if (i=0; i<n; i++) {\n",
162 " printf(\"hello %d\\n\", i);\n",
162 " printf(\"hello %d\\n\", i);\n",
163 " x += 4;\n",
163 " x += 4;\n",
164 " }"
164 " }"
165 ]
165 ]
166 },
166 },
167 {
167 {
168 "cell_type": "heading",
168 "cell_type": "heading",
169 "level": 2,
169 "level": 2,
170 "metadata": {},
170 "metadata": {},
171 "source": [
171 "source": [
172 "LaTeX equations"
172 "LaTeX equations"
173 ]
173 ]
174 },
174 },
175 {
175 {
176 "cell_type": "markdown",
176 "cell_type": "markdown",
177 "metadata": {},
177 "metadata": {},
178 "source": [
178 "source": [
179 "Courtesy of MathJax, you can include mathematical expressions both inline: \n",
179 "Courtesy of MathJax, you can include mathematical expressions both inline: \n",
180 "$e^{i\\pi} + 1 = 0$ and displayed:\n",
180 "$e^{i\\pi} + 1 = 0$ and displayed:\n",
181 "\n",
181 "\n",
182 "$$e^x=\\sum_{i=0}^\\infty \\frac{1}{i!}x^i$$"
182 "$$e^x=\\sum_{i=0}^\\infty \\frac{1}{i!}x^i$$"
183 ]
183 ]
184 },
184 },
185 {
185 {
186 "cell_type": "heading",
186 "cell_type": "heading",
187 "level": 2,
187 "level": 2,
188 "metadata": {},
188 "metadata": {},
189 "source": [
189 "source": [
190 "Github flavored markdown (GFM)"
191 ]
192 },
193 {
194 "cell_type": "markdown",
195 "metadata": {},
196 "source": [
197 "The Notebook webapp support Github flavored markdown meaning that you can use triple backticks for code blocks \n",
198 "<pre>\n",
199 "```python\n",
200 "print \"Hello World\"\n",
201 "```\n",
202 "\n",
203 "```javascript\n",
204 "console.log(\"Hello World\")\n",
205 "```\n",
206 "</pre>\n",
207 "\n",
208 "Gives \n",
209 "```python\n",
210 "print \"Hello World\"\n",
211 "```\n",
212 "\n",
213 "```javascript\n",
214 "console.log(\"Hello World\")\n",
215 "```\n",
216 "\n",
217 "And a table like this : \n",
218 "\n",
219 "<pre>\n",
220 "| This | is |\n",
221 "|------|------|\n",
222 "| a | table| \n",
223 "</pre>\n",
224 "\n",
225 "A nice Html Table\n",
226 "\n",
227 "| This | is |\n",
228 "|------|------|\n",
229 "| a | table| "
230 ]
231 },
232 {
233 "cell_type": "heading",
234 "level": 2,
235 "metadata": {},
236 "source": [
190 "General HTML"
237 "General HTML"
191 ]
238 ]
192 },
239 },
193 {
240 {
194 "cell_type": "markdown",
241 "cell_type": "markdown",
195 "metadata": {},
242 "metadata": {},
196 "source": [
243 "source": [
197 "Because Markdown is a superset of HTML you can even add things like HTML tables:\n",
244 "Because Markdown is a superset of HTML you can even add things like HTML tables:\n",
198 "\n",
245 "\n",
199 "<table>\n",
246 "<table>\n",
200 "<tr>\n",
247 "<tr>\n",
201 "<th>Header 1</th>\n",
248 "<th>Header 1</th>\n",
202 "<th>Header 2</th>\n",
249 "<th>Header 2</th>\n",
203 "</tr>\n",
250 "</tr>\n",
204 "<tr>\n",
251 "<tr>\n",
205 "<td>row 1, cell 1</td>\n",
252 "<td>row 1, cell 1</td>\n",
206 "<td>row 1, cell 2</td>\n",
253 "<td>row 1, cell 2</td>\n",
207 "</tr>\n",
254 "</tr>\n",
208 "<tr>\n",
255 "<tr>\n",
209 "<td>row 2, cell 1</td>\n",
256 "<td>row 2, cell 1</td>\n",
210 "<td>row 2, cell 2</td>\n",
257 "<td>row 2, cell 2</td>\n",
211 "</tr>\n",
258 "</tr>\n",
212 "</table>"
259 "</table>"
213 ]
260 ]
214 },
261 },
215 {
262 {
216 "cell_type": "heading",
263 "cell_type": "heading",
217 "level": 2,
264 "level": 2,
218 "metadata": {},
265 "metadata": {},
219 "source": [
266 "source": [
220 "Local files"
267 "Local files"
221 ]
268 ]
222 },
269 },
223 {
270 {
224 "cell_type": "markdown",
271 "cell_type": "markdown",
225 "metadata": {},
272 "metadata": {},
226 "source": [
273 "source": [
227 "If you have local files in your Notebook directory, you can refer to these files in Markdown cells directly:\n",
274 "If you have local files in your Notebook directory, you can refer to these files in Markdown cells directly:\n",
228 "\n",
275 "\n",
229 " [subdirectory/]<filename>\n",
276 " [subdirectory/]<filename>\n",
230 "\n",
277 "\n",
231 "For example, in the images folder, we have the Python logo:\n",
278 "For example, in the images folder, we have the Python logo:\n",
232 "\n",
279 "\n",
233 " <img src=\"images/python-logo.svg\" />\n",
280 " <img src=\"images/python-logo.svg\" />\n",
234 "\n",
281 "\n",
235 "<img src=\"images/python-logo.svg\" />\n",
282 "<img src=\"images/python-logo.svg\" />\n",
236 "\n",
283 "\n",
237 "and a video with the HTML5 video tag:\n",
284 "and a video with the HTML5 video tag:\n",
238 "\n",
285 "\n",
239 " <video controls src=\"images/animation.m4v\" />\n",
286 " <video controls src=\"images/animation.m4v\" />\n",
240 "\n",
287 "\n",
241 "<video controls src=\"images/animation.m4v\" />\n",
288 "<video controls src=\"images/animation.m4v\" />\n",
242 "\n",
289 "\n",
243 "These do not embed the data into the notebook file, and require that the files exist when you are viewing the notebook."
290 "These do not embed the data into the notebook file, and require that the files exist when you are viewing the notebook."
244 ]
291 ]
245 },
292 },
246 {
293 {
247 "cell_type": "heading",
294 "cell_type": "heading",
248 "level": 3,
295 "level": 3,
249 "metadata": {},
296 "metadata": {},
250 "source": [
297 "source": [
251 "Security of local files"
298 "Security of local files"
252 ]
299 ]
253 },
300 },
254 {
301 {
255 "cell_type": "markdown",
302 "cell_type": "markdown",
256 "metadata": {},
303 "metadata": {},
257 "source": [
304 "source": [
258 "Note that this means that the IPython notebook server also acts as a generic file server\n",
305 "Note that this means that the IPython notebook server also acts as a generic file server\n",
259 "for files inside the same tree as your notebooks. Access is not granted outside the\n",
306 "for files inside the same tree as your notebooks. Access is not granted outside the\n",
260 "notebook folder so you have strict control over what files are visible, but for this\n",
307 "notebook folder so you have strict control over what files are visible, but for this\n",
261 "reason it is highly recommended that you do not run the notebook server with a notebook\n",
308 "reason it is highly recommended that you do not run the notebook server with a notebook\n",
262 "directory at a high level in your filesystem (e.g. your home directory).\n",
309 "directory at a high level in your filesystem (e.g. your home directory).\n",
263 "\n",
310 "\n",
264 "When you run the notebook in a password-protected manner, local file access is restricted\n",
311 "When you run the notebook in a password-protected manner, local file access is restricted\n",
265 "to authenticated users unless read-only views are active."
312 "to authenticated users unless read-only views are active."
266 ]
313 ]
267 }
314 }
268 ],
315 ],
269 "metadata": {}
316 "metadata": {}
270 }
317 }
271 ]
318 ]
272 } No newline at end of file
319 }
General Comments 0
You need to be logged in to leave comments. Login now