-
Notifications
You must be signed in to change notification settings - Fork 99
Python Console Widget
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 Editor Widget — for anything longer than a one-liner
- Python GUI API — the GUI functions reachable from the console
- Python Shell — the same API without the GUI