#include <MyPython.h>
Definition at line 60 of file MyPython.h.
◆ CreatePyFunc()
static PyObject * Wasp::MyPython::CreatePyFunc |
( |
string |
moduleName, |
|
|
string |
funcName, |
|
|
string |
script |
|
) |
| |
|
static |
Create a python function object from a script
This method create a python function, named by funcName
, from the Python script script
. The script script
must contain a python function definition for a function named by funcName
. The function will be defined in the module named by moduleName
. This module must already exist in the python environment.
- Parameters
-
[in] | moduleName | Name of module in which to define the function. |
[in] | name | of function defined in the script script |
[in] | script | A string containing a valid python script |
- Return values
-
pFunc | A new PyObject reference to the defined function, or NULL if any Python API calls fail |
◆ Initialize()
int Wasp::MyPython::Initialize |
( |
| ) |
|
Initialize the Python interpreter
Checks value of VAPOR_PYHONHOME environment variable. If set, passes it's value to Py_SetPythonHome(). Otherwise uses GetAppsPath() to find the location of Python .so's and calls Py_SetPythonHome() with path returned by GetAppsPath(). Finally calls Py_Initialize()
◆ Instance()
static MyPython * Wasp::MyPython::Instance |
( |
| ) |
|
|
static |
◆ PyErr()
string Wasp::MyPython::PyErr |
( |
| ) |
|
Return python errors as a string
This method can be used to return errors generated by scripts launched by the python C API. For example, if a script run by PyRun_SimpleString fails and raises an exception this method will return the error string generated
◆ PyOut()
string Wasp::MyPython::PyOut |
( |
| ) |
|
Return stdout message as a string.
◆ IsRunningFromPython
bool Wasp::MyPython::IsRunningFromPython |
|
static |
The documentation for this class was generated from the following file: