Overview
Teaching: 15 min
Exercises: 0 minQuestionsObjectives
- How does the JupyterLab interface work?
- How do I edit Jupyter notebooks?
- How can I version control notebooks?
- Learn to navigate JupyterLab user interface.
- Discuss integrated development environments.
- Get an overview of useful keyboard shortcuts.
- Learn about command/edit modes, markdown/code cells and Git integration.
JupyterLab is the next-generation user interface for Jupyter notebooks and is intended to replace the conventional interface. It is a highly modular and customizable interface.
Let’s have a look at how it works. We go to terminal, and type:
$ mkdir jupyterlab-demo
$ cd jupyterlab-demo
$ jupyter-lab
Ctrl(⌘)-b
):
jupyterlab-git
extension installed)jupyterlab-github
extension installed)## Second level heading
This cell contains simple
[markdown](https://daringfireball.net/projects/markdown/syntax), a simple language for writing text that can be automatically converted to other formats, e.g. HTML, LaTeX or any of a number of others.
**Bold**, *italics*, **_combined_**, ~~strikethrough~~, `inline code`.
* bullet points
or
1. numbered
3. lists
**Equations:**
inline $e^{i\pi} + 1 = 0$
or on new line
$$e^{i\pi} + 1 = 0$$
Images:

Links:
[One of many markdown cheat-sheets](https://github.com/adam-p/markdown-here/wiki/Markdown-Cheatsheet#emphasis)
# a code cell can run statements of code.
# when you run this cell, the output is sent
# from the web page to a back-end process, run
# and the results are displayed to you
print("hello world")
hello world
Enter
or
double-clicking on a cellEscape
key or executing the current cell.Some shortcuts only work in Command or Edit mode.
Warning: it can happen that these shortcuts interfer with browser shortcuts.
Cell shortcuts | Notebook/UI shortcuts | ||
---|---|---|---|
Shortcut | Effect | Shortcut | Effect |
Enter |
Enter Edit mode | Ctrl(⌘) -s |
Save notebook |
Escape or Ctrl -m |
Enter Command mode | Shift -Ctrl(⌘) -s |
Save notebook as |
Ctrl -Enter |
Run the cell | Ctrl -q |
Close notebook |
Shift -Enter |
Run the cell and select the cell below | Ctrl(⌘) -b |
Toggle left-hand menu |
Alt -Enter |
Run the cell and insert a new cell below | Shift -Ctrl(⌘) -c |
Open command palette |
m and y |
Toggle between Markdown and Code cells | Shift -Ctrl(⌘) -d |
Toggle single-document mode |
d-d |
Delete a cell | ||
z |
Undo deleting | ||
a/b |
Insert cells above/below current cell | ||
x/c/v |
Cut/copy/paste cells | ||
Up/Down or k/j |
Select previous/next cells |
Discussion point: Integrated development environments
- What tools do you use for developing code?
- How do you compile or execute code?
- How do you debug code?
Some people prefer terminal-based text editors for writing code (e.g. vi/vim, nano, emacs, etc). Others prefer integrated development environments (IDEs), which can bring “everything” one needs for productive programming to one’s fingertips. Yet others prefer code editors, which are light-weight IDEs.
Terminal editor Code editor IDE Good command line skills are needed for effectively using terminal editors If you use multiple programming languages then code editors offer good support If you are working with large code bases, then you should definitely checkout the IDE suitable for your programming language Continue using Emacs and Vim, if you are already proficient Both IDE and code editors share common features such as code completion, hints, highlighting sections of code IDEs offer rich support for Debugging and Code refactoring Supports multiple programming languages Supports multiple programming languages Focused on a single language
Key Points
JupyterLab has a rich, modular and highly customizable user interface.
nbdime, jupyterlab-git and jupyterlab/github help you track notebooks with Git.