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.
Add a cell
Section titled “Add a cell”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.
Edit Python
Section titled “Edit Python”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.
Run one cell
Section titled “Run one cell”Use the triangular run button or either implemented editor shortcut:
Shift+EnterCmd+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.
Understand output
Section titled “Understand output”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.0The 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.
Run every current cell
Section titled “Run every current cell”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.
Interrupt a running cell
Section titled “Interrupt a running cell”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 or delete a cell
Section titled “Move or delete a cell”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.
Clear the active tab
Section titled “Clear the active tab”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.
Checkpoint
Section titled “Checkpoint”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.
