Embedded Python
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.
A screenshot of the interactive Python interpreter in action - all three windows are part of the Qt client process.