A web browser opens and show the "Files" tab by default. Select a "Python 3" notebook from the "New" menu.
This create a new notebook document:
Notebook documents contain the inputs and outputs of an interactive session as well as narrative text that accompanies the code but is not meant for execution. Rich output generated by running code, including HTML, images, video, and plots, is embeddeed in the notebook, which makes it a complete and self-contained record of a computation.
Change the notebook title in the header at the top. The document is store with its title as filename suffixed with .ipynb
inside your working directory.
Cf. What is a Jupyter Notebook
Notebooks consist of a linear sequence of cells containing text or executable code. The web interface represents a be-modal editor:
Command mode keys:
The default cell type is code. The code is executed on the associated kernel.
Stdout and stderr streams are displayed as text in the output area.
Clear the output of a cell by changing its type to raw an then back to code using the command keys r, y
In [3]:
import sys
print('Some text')
print('Errors...', file=sys.stderr)
Use the command key m to change the cell type to markdown.
It uses the typical Markdown notation including embeded code for illustration (inluding GitHub style syntax high-lighting):
if (i=0; i<n; i++) {
printf("hello %d\n", i);
x += 4;
}
Cf. Markdown Cells
LaTex style math equations inline expressions enclosed $ (dollar):
$x = {-b \pm \sqrt{b^2-4ac} \over 2a}$
Center a single line expressions by surrounding it with $$ (double dollar).
In [ ]:
%lsmagic
In [4]:
!date +%s
Execute Ruby code:
In [8]:
%%ruby
puts 4 * 5