#include <BALL/PYTHON/pyCAPIKernel.h>
Definition at line 10 of file pyCAPIKernel.h.
◆ PyCAPIKernel()
BALL::PyCAPIKernel::PyCAPIKernel |
( |
| ) |
|
◆ ~PyCAPIKernel()
BALL::PyCAPIKernel::~PyCAPIKernel |
( |
| ) |
|
|
override |
◆ execute()
bool BALL::PyCAPIKernel::execute |
( |
const std::string & | module, |
|
|
const std::string & | func, |
|
|
const KeyValArgs & | args ) |
|
overridevirtual |
Calls a single function from a given module.
- Parameters
-
module | a Python module |
func | a function from the given module |
args | function arguments as key-value pairs |
- Returns
- true if the execution succeeded
Implements BALL::PyKernel.
◆ getErrorMessage()
std::string BALL::PyCAPIKernel::getErrorMessage |
( |
| ) |
const |
|
inlineoverridevirtual |
Returns the most recent error message emitted by the Python interpreter.
- Returns
- most recent error message
Implements BALL::PyKernel.
Definition at line 17 of file pyCAPIKernel.h.
◆ isStarted()
bool BALL::PyCAPIKernel::isStarted |
( |
| ) |
const |
|
overridevirtual |
Checks whether the kernel is started.
- Returns
- true if kernel is started, else otherwise
Implements BALL::PyKernel.
◆ run()
std::pair< bool, std::string > BALL::PyCAPIKernel::run |
( |
std::string | str | ) |
|
|
overridevirtual |
Executes a single Python string.
- Parameters
-
str | correctly indented Python string |
- Returns
- The first value indicated whether the execution succeeded. The second value is the output generated by the execution, if any.
Implements BALL::PyKernel.
◆ runFile()
Executes a single Python file.
- Parameters
-
- Returns
- true if the execution succeeded
- Deprecated
- Use Jupyter notebook plugin instead
Implements BALL::PyKernel.