32 #ifndef PYTHON_CLASS_H__ 33 #define PYTHON_CLASS_H__ 43 #if PY_MAJOR_VERSION >= 3 45 #define PyInt_AsLong PyLong_AsLong 49 #define PyInt_Check PyLong_Check 52 #ifndef PyInt_FromLong 53 #define PyInt_FromLong PyLong_FromLong 56 #ifndef PyString_Check 57 #define PyString_Check PyUnicode_Check 60 #ifndef PyString_FromString 61 #define PyString_FromString PyUnicode_FromString 133 static PyObject *
pass_instance (
void* instance,
const char* class_name);
155 static PyObject *module;
157 static string as_string(PyObject *s);
167 extern PyObject *globals;
171 #endif // PYTHON_CLASS_H__ Class to write data from a Gzip compressed file.
static bool exec_file(string filename)
Executes a Python script.
Class to read data from a Gzip compressed file.
static void put_tuple(PyObject *tuple, ogzstream &file)
Save a Python tuple into a file.
static void show_traceback(void)
Dumps any error information to stderr.
static PyObject * get_tuple(igzstream &file)
Loads a Python tuple previously saved with put_tuple ().
static PyObject * import_module(string filename)
Imports a Python module.
static PyObject * pass_instance(void *instance, const char *class_name)
Magic function that makes any C object available to Python!
static void insert_path(char *name)
Adds a directory to Python's include path.
static void exec_string(const char *s)
Execute Python statements contained in a string.
Grant simplified access to the Python interpreter.
Declares the igzstream, ogzstream and fileops classes.
static void cleanup()
Cleanup Python.
static void init()
Initialise Python and insert the Adonthell include paths.