Embedded Python: Difference between revisions
No edit summary |
No edit summary |
||
Line 9: | Line 9: | ||
Class pqPythonShell uses pqConsole to provide an interactive Python shell, by handling Python-specific behavior, e.g. prompts, multiple-line statements, and redirection of Python output to the console. | Class pqPythonShell uses pqConsole to provide an interactive Python shell, by handling Python-specific behavior, e.g. prompts, multiple-line statements, and redirection of Python output to the console. | ||
A screenshot of the interactive Python interpreter in action - all three windows are part of | ==Obligatory Screenshot== | ||
A screenshot of the interactive Python interpreter in action - all three windows are part of a single Qt client process. | |||
[[Image:Embedded_python.png]] | [[Image:Embedded_python.png]] |
Revision as of 11:55, 22 November 2005
Overview
For development and troubleshooting purposes only, a Python interpreter has been embedded in the Qt client. This will allow developers to query the internal state of the running client, without having to restart, set breakpoints in a debugger, etc. The embedded interpreter will not have access to UI state.
Design Details
Class pqConsole provides a generic Qt console interface widget that prints text to the screen and handles line-oriented user input. pqConsole also provides a command-history (accessible with up-arrow and down-arrow keys) and the ability to alter output text color and format.
Class pqPythonShell uses pqConsole to provide an interactive Python shell, by handling Python-specific behavior, e.g. prompts, multiple-line statements, and redirection of Python output to the console.
Obligatory Screenshot
A screenshot of the interactive Python interpreter in action - all three windows are part of a single Qt client process.