Embedded Python

From ParaQ Wiki
Revision as of 11:53, 22 November 2005 by Tshead (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigationJump to search

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.

Embedded python.png