Fledge
An open source edge computing platform for industrial users
PythonRuntime Class Reference

Public Member Functions

void execute (const std::string &python)
 Execute simple Python script passed as a string. More...
 
PyObject * call (const std::string &name, const std::string &fmt,...)
 
PyObject * call (PyObject *module, const std::string &name, const std::string &fmt,...)
 
PyObject * importModule (const std::string &name)
 Import a Python module. More...
 

Static Public Member Functions

static PythonRuntimegetPythonRuntime ()
 Get PythonRuntime singleton instance for the process. More...
 
static bool initialised ()
 
static void shutdown ()
 Shutdown an instance of a Python runtime if one has been started.
 

Member Function Documentation

◆ execute()

void PythonRuntime::execute ( const std::string &  python)

Execute simple Python script passed as a string.

Parameters
pythonThe Python code to run

◆ getPythonRuntime()

PythonRuntime * PythonRuntime::getPythonRuntime ( )
static

Get PythonRuntime singleton instance for the process.

Returns
Singleton PythonRuntime instance

◆ importModule()

PyObject * PythonRuntime::importModule ( const std::string &  name)

Import a Python module.

Parameters
nameThe name of the module to import
Returns
PyObject* The Python module

The documentation for this class was generated from the following files: