Skip to content

Python Console Widget

julianspeith edited this page Sep 29, 2026 · 8 revisions

The Python Console Widget provides an interactive console in which python code can be executed. The python console is connected to the hal python environment so that the Python Core API and Python GUI API are accessible. Code completion and code suggestion via Tab are also supported to some extent.

Commands are executed in the same Python namespace (__main__) as scripts run from the Python Editor Widget, so variables and functions defined in one are available in the other. The commands quit(), help(), and license() cannot be used in the console. Instead, the console provides clear() to clear the console output and reset(), which also clears the console output. Note that reset() currently does not remove variables defined by previous commands or scripts from the shared namespace. Both functions only work in the console, not in scripts run from the editor.

Python Console

See also

Clone this wiki locally