embedded program questions

Mark Harrison mh at pixar.com
Wed Mar 12 23:47:34 CET 2003

newbie alert... your patience is appreciated.
Can someone loan me a clue on these questions?

1.  Is it possible to detect an error from Py_Initialize?  I basically
    want something like

        if (Py_Initialize() has an error)
            log error and restart things as necessary

2.  How can I capture errors from the PyRun_ functions?  I would
    like to something like

        if ((rc = PyRun_SimpleString("a = 10 10")) != 0) {

    but catch and report the result or error myself.
    It seems that I can call Py_CompileString, but I can't
    figure out what to do with the object returned. :-/

3.  Can I instantiate multiple interpreters in the same program?
    E.g., I have a server and I would like each client to have
    its own dedicated interpreter.

4.  Is there such as thing as Tcl's safe interpreter model?

Many TIA,

Mark Harrison
Pixar Animation Studios

More information about the Python-list mailing list