Class CPyInstance

Class Documentation

class CPyInstance

class for initializing a Python interpreter object

Public Functions

inline CPyInstance()

class constructor

default constructor initializes interpreter

inline CPyInstance(const char *pythonpath)

class constructor

sets PYTHONPATH and initializes interpreter

Parameters:

pythonpath[in] path to set PYTHONPATH environment variable

inline ~CPyInstance()

class de-constructor

restores original PYTHONPATH on destruction

inline void print_python_error(const std::string &function)

writes to stderr when a Python error occurs

PyErr_Print() should only be called when PyErr_Occurred() so this wraps that for safety.

Parameters:

function[in] name of function where error occurred

inline bool is_initialized()