Grant simplified access to the Python interpreter. More...
#include <python_class.h>
Static Public Member Functions | |
static void | init () |
Initialise Python and insert the Adonthell include paths. | |
static void | cleanup () |
Cleanup Python. | |
static void | insert_path (char *name) |
Adds a directory to Python's include path. | |
static void | exec_string (char *s) |
Execute Python statements contained in a string. | |
static bool | exec_file (string filename) |
Executes a Python script. | |
static PyObject * | import_module (string filename) |
Imports a Python module. | |
static void | show_traceback (void) |
Dumps any error information to stderr. | |
static PyObject * | pass_instance (void *instance, const char *class_name) |
Magic function that makes any C object available to Python! | |
static PyObject * | get_tuple (igzstream &file) |
Loads a Python tuple previously saved with put_tuple (). | |
static void | put_tuple (PyObject *tuple, ogzstream &file) |
Save a Python tuple into a file. | |
Static Public Attributes | |
static PyObject * | module |
Grant simplified access to the Python interpreter.
Definition at line 41 of file python_class.h.
void python::init | ( | ) | [static] |
Initialise Python and insert the Adonthell include paths.
Definition at line 40 of file python_class.cc.
void python::cleanup | ( | void | ) | [static] |
void python::insert_path | ( | char * | name | ) | [static] |
Adds a directory to Python's include path.
name | directory to add to Python's include path. |
Definition at line 60 of file python_class.cc.
void python::exec_string | ( | char * | s | ) | [static] |
Execute Python statements contained in a string.
s | string containing Python statements to execute. |
Definition at line 75 of file python_class.cc.
bool python::exec_file | ( | string | filename | ) | [static] |
Executes a Python script.
filename | name of the file to execute. |
Definition at line 83 of file python_class.cc.
PyObject * python::import_module | ( | string | filename | ) | [static] |
Imports a Python module.
filename | file name of the module to import. |
Definition at line 113 of file python_class.cc.
void python::show_traceback | ( | void | ) | [static] |
Dumps any error information to stderr.
Definition at line 103 of file python_class.cc.
PyObject * python::pass_instance | ( | void * | instance, | |
const char * | class_name | |||
) | [static] |
Magic function that makes any C object available to Python!
instance | pointer to the instance to pass. | |
class_name | name of the class of the passed instance. |
Definition at line 124 of file python_class.cc.
PyObject * python::get_tuple | ( | igzstream & | file | ) | [static] |
Loads a Python tuple previously saved with put_tuple ().
file | Opened file where to load the tuple from. |
Definition at line 130 of file python_class.cc.
void python::put_tuple | ( | PyObject * | tuple, | |
ogzstream & | file | |||
) | [static] |
Save a Python tuple into a file.
tuple | Python tuple to save. | |
file | Opened file where to save the tuple to. |
Definition at line 163 of file python_class.cc.