PyRun_File / PyRun_String

Ulrich Huenemoerder uhuenemoerder at hotmail.com
Sat Nov 6 15:06:46 EST 1999


Hello,

this might have been asked before, but be sure I looked up deja.com etc.
before I sent this mail.

I would like to embed Python into my C++ Application. I already looked up
the functions PyRun_SimpleFile and PyRun_SimpleString, but since I need
multiple independent interpreters at once I think PyRun_File and
PyRun_String are the functions I need.

Could anyone provide me with the code for a small example app, like

// initialization
Py_Initialize();
...

// initialize the interpreter
...

// parse a file
PyRun_File(...);

// parse a string
PyRun_String(...);

// that's it.

Thanks,

Ulrich.






More information about the Python-list mailing list