Embedding Python

Functions to use:

Py_Initialize()
Call once, before any other Python functions
Py_Finalize()
Call before exiting program

PyRun_SimpleString(string)
Executes Python code in a character string (char *)

PyRun_SimpleFile(filePointer, fileName)
Executes Python code in a file

Other functions exist for more advanced access to Python features (e.g. creating Python objects)


next