OpenSite/Reference/Features/Python workbench: Difference between revisions
BathAfrica (talk | contribs) Use BathAfrica sidebar contents without duplicate inline contents box |
BathAfrica (talk | contribs) Link adjacent OpenSite reference pages in reading order |
||
| (One intermediate revision by the same user not shown) | |||
| Line 1: | Line 1: | ||
__NOTOC__ | __NOTOC__ | ||
{{OpenSite scope}} | |||
{{BathAfrica Feature | {{BathAfrica Feature | ||
|id=python.workbench | |id=python.workbench | ||
|summary=Edit, run, and debug Python in the desktop workbench, and publish Matplotlib figures to a host viewer. | |summary=Edit, run, and debug Python in the desktop workbench, and publish Matplotlib figures to a host viewer. | ||
| Line 14: | Line 14: | ||
}} | }} | ||
== Try this workflow == | |||
[[OpenSite/Guides/Run your first script|Run your first script]] — a worked lesson with expected results. | |||
== Documentation basis == | == Documentation basis == | ||
| Line 23: | Line 26: | ||
[[OpenSite|OpenSite overview]] · [[OpenSite/Reference|Reference]] · [[OpenSite/Guides|Guides]] | [[OpenSite|OpenSite overview]] · [[OpenSite/Reference|Reference]] · [[OpenSite/Guides|Guides]] | ||
[[Category:OpenSite documentation]] | [[Category:OpenSite documentation]] | ||
<div class="os-page-nav">{{Docnav|OpenSite/Reference/Features/Plugins|OpenSite/Reference/Features/Python scripting|OpenSite/Guides|All guides}}</div> | |||
Latest revision as of 14:15, 29 October 2026
Edit, run, and debug Python in the desktop workbench, and publish Matplotlib figures to a host viewer.
- Stable identifier
python.workbench
Status reported by source
Implemented in the reviewed development source. Historical test evidence is recorded by the repository; no test rerun or product release is claimed by this publication.
Units
Script buffers are not engineering documents. A quantity edited through an existing document command keeps its canonical SI value.
Behavior
The workbench id is opensite.workbench.python; its GUI extension is opensite.extension.python-workbench. It shares the console interpreter and execution lane. New, Open, Save, Save As and Close operate on script tabs. Run supports a file, selection or current line. Rerun retains interpreter/application state. Unsaved execution does not save the buffer. Current-file assistance is separate from runtime console completion. Debug supports Python-line stepping and cooperative stop. opensite.plot.show() publishes open figures; show(figure) and publish(figure) use the Agg-backed plot viewer. Script stdout/stderr is assembled in the host Output panel; the interactive Console remains separate.
Errors
A second run while the lane is queued, running, paused, or stopping is rejected. A closed or replaced document read returns stale_document. A document read from the Python lane during an application-thread callback returns reentrant_call. An expression watch is rejected. A plot outside the size or memory limits is rejected and reported. Stop raises KeyboardInterrupt at the next Python check.
Limitations
Assistance is the current file. It does not infer types across files. The debugger steps Python lines. Native code stays running until it returns to Python. Stop is cooperative. Zoom and pan navigate the published raster and do not redraw Matplotlib axes. The embedded interpreter and Agg are not a sandbox. The distributable GUI SDK is not installed.
Available hosts
The Windows desktop when GUI and Python are both enabled. The headless SDK does not load this extension.
Licensing and access
No new third-party editor, language server, or debugger package. Matplotlib remains the scientific-bundle component. In-process Python is trusted code.
Verification evidence
Repository evidence references (not rerun for this publication): docs/verification/Phase-11-Python-Workbench.md. ADR-0042.
Try this workflow
Run your first script — a worked lesson with expected results.
Documentation basis
Source-reviewed against development commit 77c3fee13944bcc4b5d487c77eb1f82fbe4c6ea7, branch feature/phase-13c-properties-python-expressions. This review inspected the implementation and repository evidence; it did not run the Windows application or repeat CTest.
src/extensions/python_workbench/python_workbench_extension.cppdocs/verification/Phase-13C-Integration.md