How to run more than one instance of the Python interpreter in one process?

Tim Peters tim.one at home.com
Sun Jan 7 05:16:52 EST 2001


[Syver Enstad]
> I am fiddling around with embedding Python in C/C++ and am trying
> to run one interpreter per thread. I've tried using the
> Py_NewInterpreter and Py_EndInterpreter for each thread but it
> doesn't seem to be enough because I trigger access violations in
> the interpreter so I am obviously missing a couple of things. Are
> there any examples on how to do these kinds of things other than
> the very sparse code in the demo folder of the source distribution.

None that I've ever seen, or heard of.  Py_{New,End}Interpreter appeared to
have been added during a brief bout of Tcl Envy, and neglected thereafter.
The natural place to talk about this is the Python Thread-SIG:

    http://www.python.org/sigs/thread-sig/

But, in the past, I was unable to get anyone there to admit they used this
API either.  You should bring it up there, though; at least Guido may be
interested.  Be sure to say which version of Python you're using and which
platform you're running on.

there-are-no-access-violations-under-windows<wink>-ly y'rs  - tim





More information about the Python-list mailing list