Show More
@@ -7,7 +7,7 b' The IPython Notebook' | |||||
7 |
|
7 | |||
8 | :ref:`Installation requirements <installnotebook>` for the Notebook. |
|
8 | :ref:`Installation requirements <installnotebook>` for the Notebook. | |
9 |
|
9 | |||
10 |
The IPython Notebook co |
|
10 | The IPython Notebook combines two components: | |
11 |
|
11 | |||
12 | * A web application, called the *IPython Notebook web app*, for interactive authoring of literate computations, in which explanatory text, mathematics, computations and rich media output may be combined. Input and output are stored in persistent cells that may be edited in-place. |
|
12 | * A web application, called the *IPython Notebook web app*, for interactive authoring of literate computations, in which explanatory text, mathematics, computations and rich media output may be combined. Input and output are stored in persistent cells that may be edited in-place. | |
13 |
|
13 | |||
@@ -35,7 +35,7 b' features of the IPython Notebook app include:' | |||||
35 |
|
35 | |||
36 | If you have ever used the Mathematica or SAGE notebooks (the latter is also |
|
36 | If you have ever used the Mathematica or SAGE notebooks (the latter is also | |
37 | web-based__) you should feel right at home. If you have not, you will be |
|
37 | web-based__) you should feel right at home. If you have not, you will be | |
38 |
able to learn how to use |
|
38 | able to learn how to use the IPython Notebook in just a few minutes. | |
39 |
|
39 | |||
40 | .. __: http://sagenb.org |
|
40 | .. __: http://sagenb.org | |
41 |
|
41 | |||
@@ -74,22 +74,19 b' how to install the notebook and its dependencies.' | |||||
74 | Starting the IPython Notebook web app |
|
74 | Starting the IPython Notebook web app | |
75 | ===================================== |
|
75 | ===================================== | |
76 |
|
76 | |||
77 |
The Notebook web app |
|
77 | The Notebook web app is started with the command:: | |
78 |
|
78 | |||
79 | $ ipython notebook |
|
79 | $ ipython notebook | |
80 |
|
80 | |||
81 | The landing page of the notebook server application, the *dashboard*, shows the notebooks currently available in the working directory (the directory from which the notebook was started). |
|
81 | The landing page of the notebook server application, the *dashboard*, shows the notebooks currently available in the *working directory* (the directory from which the notebook was started). | |
82 | You can create new notebooks from the dashboard with the ``New Notebook`` |
|
82 | You can create new notebooks from the dashboard with the ``New Notebook`` | |
83 | button, or open existing ones by clicking on their name. |
|
83 | button, or open existing ones by clicking on their name. | |
|
84 | You can also drag and drop ``.ipynb`` notebooks and standard ``.py`` Python source code files into the notebook list area. | |||
84 |
|
85 | |||
|
86 | ``.py`` files will be imported into the IPython Notebook as a notebook with the same name, but an ``.ipynb`` extension, located in the working directory. The notebook will consist of a single cell containing all the | |||
|
87 | code in the ``.py`` file, which you can later manually partition into individual cells. | |||
85 |
|
88 | |||
86 | You can also drag and drop into the area listing files any ``.py`` |
|
89 | .. Alternatively, prior to importing the ``.py``, you can manually add ``# <nbformat>2</nbformat>`` at the start of the file, and then add separators for text and code cells, to get a cleaner import with the file already broken into individual cells. | |
87 | file: it will be imported into a notebook with the same name (but |
|
|||
88 | ``.ipynb`` extension), located in the working directory. This notebook will consist of a single cell with all the code in the file, which you can later manually partition into individual cells for gradual execution, and add text |
|
|||
89 | and graphics, etc. |
|
|||
90 | Alternatively, |
|
|||
91 | prior to import, you can manually add ``# <nbformat>2</nbformat>`` |
|
|||
92 | markers at the start and then add separators for text/code cells, to get a cleaner import with the file already broken into individual cells. |
|
|||
93 |
|
|
90 | ||
94 |
|
|
91 | ||
95 | The IPython Notebook web app is based on a server-client structure. |
|
92 | The IPython Notebook web app is based on a server-client structure. | |
@@ -103,16 +100,16 b' Basic workflow' | |||||
103 | When you open or create a new notebook, your browser tab will reflect the name of that notebook, prefixed with "IPy". |
|
100 | When you open or create a new notebook, your browser tab will reflect the name of that notebook, prefixed with "IPy". | |
104 | The URL is currently not meant to be human-readable and is not persistent across invocations of the notebook server; however, this will change in a future version of IPython. |
|
101 | The URL is currently not meant to be human-readable and is not persistent across invocations of the notebook server; however, this will change in a future version of IPython. | |
105 |
|
102 | |||
106 |
The normal workflow in a notebook is quite similar to a |
|
103 | The normal workflow in a notebook is quite similar to a standard IPython | |
107 | session, with the difference that you can edit a cell in-place multiple |
|
104 | session, with the difference that you can edit a cell in-place multiple | |
108 |
times until you obtain the desired results |
|
105 | times until you obtain the desired results, rather than having to | |
109 |
rerun separate scripts with the ``%run`` magic |
|
106 | rerun separate scripts with the ``%run`` magic. (Magics do, however, also work | |
110 |
in the notebook |
|
107 | in the notebook.) Typically, you'll work on a problem in pieces, | |
111 | organizing related pieces into cells and moving forward as previous |
|
108 | organizing related pieces into cells and moving forward as previous | |
112 | parts work correctly. This is much more convenient for interactive exploration than breaking up a computation into scripts that must be |
|
109 | parts work correctly. This is much more convenient for interactive exploration than breaking up a computation into scripts that must be | |
113 | executed together, especially if parts of them take a long time to run |
|
110 | executed together, especially if parts of them take a long time to run | |
114 |
|
111 | |||
115 |
The only significant limitation that the notebook currently has, compared to the |
|
112 | The only significant limitation that the notebook currently has, compared to the Qt console, is that it cannot run any code that | |
116 | expects input from the kernel (such as scripts that call |
|
113 | expects input from the kernel (such as scripts that call | |
117 | :func:`raw_input`). Very importantly, this means that the ``%debug`` |
|
114 | :func:`raw_input`). Very importantly, this means that the ``%debug`` | |
118 | magic does *not* currently work in the notebook! This limitation will |
|
115 | magic does *not* currently work in the notebook! This limitation will | |
@@ -121,30 +118,6 b' If your notebook is running on a local' | |||||
121 | computer (i.e. if you are accessing it via your localhost address at ``127.0.0.1``), you can just type ``%qtconsole`` in the notebook and a Qt console will open up, connected to that same kernel. |
|
118 | computer (i.e. if you are accessing it via your localhost address at ``127.0.0.1``), you can just type ``%qtconsole`` in the notebook and a Qt console will open up, connected to that same kernel. | |
122 |
|
119 | |||
123 |
|
120 | |||
124 | Connecting to an existing kernel |
|
|||
125 | --------------------------------- |
|
|||
126 |
|
||||
127 | The notebook server always prints to the terminal the full details of |
|
|||
128 | how to connect to each kernel, with lines like:: |
|
|||
129 |
|
||||
130 | [IPKernelApp] To connect another client to this kernel, use: |
|
|||
131 | [IPKernelApp] --existing kernel-3bb93edd-6b5a-455c-99c8-3b658f45dde5.json |
|
|||
132 |
|
||||
133 | This is the name of a JSON file that contains all the port and |
|
|||
134 | validation information necessary to connect to the kernel. You can |
|
|||
135 | manually start a Qt console with:: |
|
|||
136 |
|
||||
137 | ipython qtconsole --existing kernel-3bb93edd-6b5a-455c-99c8-3b658f45dde5.json |
|
|||
138 |
|
||||
139 | and if you only have a single kernel running, simply typing:: |
|
|||
140 |
|
||||
141 | ipython qtconsole --existing |
|
|||
142 |
|
||||
143 | will automatically find it (it will always find the most recently |
|
|||
144 | started kernel if there is more than one). You can also request this |
|
|||
145 | connection data by typing ``%connect_info``; this will print the same |
|
|||
146 | file information as well as the content of the JSON data structure it contains. |
|
|||
147 |
|
||||
148 | Cell types |
|
121 | Cell types | |
149 | ---------- |
|
122 | ---------- | |
150 |
|
123 | |||
@@ -387,6 +360,31 b' server is for some reason non-responsive.' | |||||
387 | Quick how to's |
|
360 | Quick how to's | |
388 | ============== |
|
361 | ============== | |
389 |
|
362 | |||
|
363 | Connecting to an existing kernel | |||
|
364 | --------------------------------- | |||
|
365 | ||||
|
366 | The notebook server always prints to the terminal the full details of | |||
|
367 | how to connect to each kernel, with lines like:: | |||
|
368 | ||||
|
369 | [IPKernelApp] To connect another client to this kernel, use: | |||
|
370 | [IPKernelApp] --existing kernel-3bb93edd-6b5a-455c-99c8-3b658f45dde5.json | |||
|
371 | ||||
|
372 | This is the name of a JSON file that contains all the port and | |||
|
373 | validation information necessary to connect to the kernel. You can | |||
|
374 | manually start a Qt console with:: | |||
|
375 | ||||
|
376 | ipython qtconsole --existing kernel-3bb93edd-6b5a-455c-99c8-3b658f45dde5.json | |||
|
377 | ||||
|
378 | and if you only have a single kernel running, simply typing:: | |||
|
379 | ||||
|
380 | ipython qtconsole --existing | |||
|
381 | ||||
|
382 | will automatically find it (it will always find the most recently | |||
|
383 | started kernel if there is more than one). You can also request this | |||
|
384 | connection data by typing ``%connect_info``; this will print the same | |||
|
385 | file information as well as the content of the JSON data structure it contains. | |||
|
386 | ||||
|
387 | ||||
390 | Running a public notebook server |
|
388 | Running a public notebook server | |
391 | -------------------------------- |
|
389 | -------------------------------- | |
392 |
|
390 |
General Comments 0
You need to be logged in to leave comments.
Login now