Skip to content

Work with cells

A Molt tab is an ordered list of Python code cells. This guide covers the complete cell workflow and the release-specific consequences of each control.

Use either insertion control:

  • Select the permanent + Add cell button below the final cell to append a cell.
  • Move the pointer into the gap between two cells, then select the temporary + Add cell button to insert there.

Molt focuses a cell created through either button.

Running the final nonempty cell also appends a new empty cell automatically.

Each cell uses CodeMirror with Python syntax highlighting, line wrapping, and standard editor key bindings. Press Tab to indent.

Molt updates its in-memory source as you type. Source and cell ordering are autosaved after changes settle for about 1.5 seconds.

Use the triangular run button or either implemented editor shortcut:

  • Shift+Enter
  • Cmd+Enter

Both shortcuts ignore whitespace-only cells, ensure the tab’s kernel exists, clear the previous output, assign the next execution number, execute the current source, and render text or errors. Shift+Enter then advances to the next cell, appending one when needed. Cmd+Enter keeps focus in the current cell.

Molt captures three text channels:

Output Rendering
Standard output Normal monospace text
Standard error Amber text
Unhandled exception Red error block containing the traceback

The value of a final bare expression is displayed with repr, similar to a notebook:

values = [2, 4, 8]
values[-1] / values[0]
4.0

The last non-None expression value is also assigned to _ inside that tab’s namespace.

Molt does not render images, HTML, tables, widgets, or Jupyter display objects. See Current limitations.

Select Run All in the toolbar. Molt walks the cells that existed when the action began, top to bottom, and awaits each one before starting the next. Empty cells are skipped.

A Python or transport error is rendered on its cell and stops the remaining Run All sequence. Run All does not append a cell or advance focus.

While a cell is running, its triangular button changes to a square. Select it to request an interrupt.

The backend sends SIGINT, then force-kills the process after two seconds only if the same execution remains busy. A completed KeyboardInterrupt response preserves the process.

Move the pointer over a cell to reveal controls in its upper-right corner:

  • moves the cell one position upward.
  • moves the cell one position downward.
  • × deletes the cell.

Deleting the only cell immediately creates a fresh empty replacement, so a tab is never left without a cell.

Cell deletion has no confirmation. The changed structure is autosaved.

Select Clear to stop the active kernel and replace every cell in the tab with one empty cell. Clear also resets execution labels and queued focus state, and leaves the kernel stopped.

Select Restart before executing new code in the cleared tab.

After practicing these operations, you should be able to:

  • Insert a cell at any position.
  • Run one cell or the current sequence.
  • Recognize stdout, stderr, and traceback output.
  • Reorder or delete cells.
  • Explain why Clear and Restart are different operations.