Zoom Jupyter

Last updated: January 4, 2023

 Table of contents

JupyterHub access

For this course, we will use a temporary JupyterHub running on one of our training clusters.

For today, here is how to log in:

  • Set the server options as follows:
  • Press start

Note that, unlike other JupyterHubs you might have used (e.g. syzygy.ca), this JupyterHub is not permanent and can only be used for this course.

Jupyter tips

Help

help is a Python built-in function (it is a wrapper around pydoc.help) which provides some help on code elements (functions, etc.). While some of the tips presented here only work on Jupyter, this also works in the Python shell:

help(sum)

Autocompletion

Pressing Tab after a few characters of code autocompletes or displays available options. This also works in the Python shell.

Function arguments

Pressing Shift+Tab inside the parentheses of a function opens a popup showing all the function arguments and their default values (if any).

Information

In Jupyter, you can access information on a Python element by prepending or appending a question mark to it:

?sum
sum?

Source code

By using two question marks, you can see the source code:

??sum
sum??

Important menus

  • File/Save As: rename your notebook
  • File/New Launcher: open a new launcher dashboard, e.g. to start a terminal
  • File/Logout: terminate your job (your Jupyter session is running inside a Slurm job)

Main key bindings

Mode switching

  • Esc: leave edit mode and enter command mode (in command mode, the cell border is blue)
  • Enter: leave command mode and enter edit mode (in edit mode, the cell border is green)

Key bindings for both modes

  • Ctrl+Enter: execute current cell
  • Alt+Enter: execute current cell and insert cell below
  • Shift+Enter: execute current cell and focus on cell below
  • Ctrl+S: save notebook and checkpoint

Key bindings in command mode

  • "Up/Down": navigate to the cell above/below
  • "A": insert a cell above the current cell
  • "B": insert a cell below the current cell
  • "X": cut the current cell
  • "C": copy the current cell
  • "V": paste the previously cut or copied cell
  • "M": turn the current cell into a markdown cell
  • "H": display help

Comments & questions