Mantid
|
This is the base class all customised user interfaces that do not wish to be tied to a specific Mantid algorithm but rather customised for user's requirements. More...
#include <PythonRunner.h>
Signals | |
void | runAsPythonScript (const QString &code, bool) |
Public Member Functions | |
PythonRunner () | |
Default constructor. More... | |
QString | runPythonCode (const QString &code, bool no_output=false) |
Run python code. More... | |
Static Public Member Functions | |
static const QString | stringList2Tuple (const QStringList &list) |
Converts a list of strings into a string recognised by Python as a tuple. More... | |
This is the base class all customised user interfaces that do not wish to be tied to a specific Mantid algorithm but rather customised for user's requirements.
Definition at line 26 of file PythonRunner.h.
|
inline |
Default constructor.
Definition at line 31 of file PythonRunner.h.
|
signal |
Referenced by runPythonCode().
QString PythonRunner::runPythonCode | ( | const QString & | code, |
bool | no_output = false |
||
) |
Run python code.
Run a piece of python code and return any output that it writes to stdout.
code | :: the Python commands to execute |
no_output | :: if set to true this method returns an empty string, if false it returns the output from any Python print statements |
Definition at line 31 of file PythonRunner.cpp.
References Mantid::Kernel::Logger::debug(), Mantid::Kernel::Logger::is(), and runAsPythonScript().
Referenced by MantidQt::API::MantidDialog::runPythonCode(), MantidQt::API::MantidWidget::runPythonCode(), and MantidQt::API::UserSubWindow::runPythonCode().
|
static |
Converts a list of strings into a string recognised by Python as a tuple.
This Python helper function converts a list of strings into one string that Python will recognise as a Python tuple.
list | string entries |
Definition at line 76 of file PythonRunner.cpp.