pqPythonShell is a QWidget subclass that provides an interactive Python shell.
More...
#include <pqPythonShell.h>
Inherits QWidget.
|
void | executing (bool starting) |
| signal fired whenever the shell starts (starting=true) and finishes (starting=false) executing a Python command/script. More...
|
|
|
void | setupInterpreter () |
| Called to setup the Python interpreter during startup or after the Python environment was finalized. More...
|
|
bool | prompt (const QString &indent=QString()) |
| Show the user-input prompt, if needed. More...
|
|
void | HandleInterpreterEvents (vtkObject *caller, unsigned long eventid, void *calldata) |
|
|
static const char * | PS1 () |
|
static const char * | PS2 () |
|
pqPythonShell is a QWidget subclass that provides an interactive Python shell.
It uses vtkPythonInterpreter to provide an interactive Python terminal without starting a separate Python event loop.
Python will be initialized (if not already), when pqPythonShell is instantiated.
- See also
- pqConsoleWidget, pqPythonDialog.
Definition at line 53 of file pqPythonShell.h.
§ PrintMode
§ pqPythonShell()
pqPythonShell::pqPythonShell |
( |
QWidget * |
parent = 0 , |
|
|
Qt::WindowFlags |
flags = 0 |
|
) |
| |
§ ~pqPythonShell()
pqPythonShell::~pqPythonShell |
( |
| ) |
|
§ consoleLocals()
void* pqPythonShell::consoleLocals |
( |
| ) |
|
Returns the interactive console context (the locals() dict).
You can use static_cast<PythonObject*>() to convert the void pointer. See vtkPythonInteractiveInterpreter::GetInteractiveConsoleLocalsPyObject().
§ printMessage
void pqPythonShell::printMessage |
( |
const QString & |
| ) |
|
|
slot |
Prints some text on the shell.
§ clear
void pqPythonShell::clear |
( |
| ) |
|
|
slot |
Clears the terminal.
This does not change the state of the Python interpreter, just clears the text shown in the Widget.
§ executeScript
void pqPythonShell::executeScript |
( |
const QString & |
| ) |
|
|
slot |
Execute an arbitrary python script/string.
This simply execute the Python script in the global Python interpreter.
§ reset
void pqPythonShell::reset |
( |
| ) |
|
|
slot |
Resets the python interactive interpreter.
This does not affect the global Python interpreter.
§ isExecuting
bool pqPythonShell::isExecuting |
( |
| ) |
const |
|
inlineslot |
Returns true is the shell is currently executing a script/command.
Definition at line 103 of file pqPythonShell.h.
§ printString
void pqPythonShell::printString |
( |
const QString & |
, |
|
|
PrintMode |
mode = STATUS |
|
) |
| |
|
slot |
§ setPreamble
static void pqPythonShell::setPreamble |
( |
const QStringList & |
statements | ) |
|
|
staticslot |
Set a list of statements to be run each time the interpreter is reset.
By default, this imports the paraview.simple module. If you call this method, be aware that the preamble is assumed not to have any multi-line statements.
§ executing
void pqPythonShell::executing |
( |
bool |
starting | ) |
|
|
signal |
signal fired whenever the shell starts (starting=true) and finishes (starting=false) executing a Python command/script.
This can be used by the UI to block user input while the script is executing.
§ pushScript
void pqPythonShell::pushScript |
( |
const QString & |
| ) |
|
|
protectedslot |
§ setExecuting
void pqPythonShell::setExecuting |
( |
bool |
val | ) |
|
|
inlineprotectedslot |
§ PS1()
static const char* pqPythonShell::PS1 |
( |
| ) |
|
|
inlinestaticprotected |
§ PS2()
static const char* pqPythonShell::PS2 |
( |
| ) |
|
|
inlinestaticprotected |
§ setupInterpreter()
void pqPythonShell::setupInterpreter |
( |
| ) |
|
|
protected |
Called to setup the Python interpreter during startup or after the Python environment was finalized.
§ prompt()
bool pqPythonShell::prompt |
( |
const QString & |
indent = QString() | ) |
|
|
protected |
Show the user-input prompt, if needed.
Returns true if the prompt was re-rendered, otherwise false.
§ HandleInterpreterEvents()
void pqPythonShell::HandleInterpreterEvents |
( |
vtkObject * |
caller, |
|
|
unsigned long |
eventid, |
|
|
void * |
calldata |
|
) |
| |
|
protected |
§ pqPythonManager
§ ConsoleWidget
§ Interpreter
vtkPythonInteractiveInterpreter* pqPythonShell::Interpreter |
|
protected |
§ Prompt
const char* pqPythonShell::Prompt |
|
protected |
§ Preamble
QStringList pqPythonShell::Preamble |
|
staticprotected |
The documentation for this class was generated from the following file: