Multiple simultaneous Python interpreters

Thomas Heller theller at
Wed Mar 19 13:41:21 CET 2003

"White Flame \(aka David Holz\)" <whiteflame52 at> writes:

> Hi, I'm evaluating Python as a scripting language in a project I'm defining.
> Is there any way to encapsulate the interpreter so that multiple ones can
> exist in a program?  Some would be in their own thread, some would get
> called from the same one sequentially.  However, in the docs I've read,
> there's always just been one "global" interpreter.  Not very OO for an OO
> language. ;-)

PyThreadState* Py_NewInterpreter()

    Create a new sub-interpreter. This is an (almost) totally separate
    environment for the execution of Python code.

found here:


More information about the Python-list mailing list