Problems in using wxPython in a multithreaded context‏

mec2paris paris mec2paris at gmail.com
Mon Oct 22 05:42:34 PDT 2007


For my C application, I use many interpreters (withh the fonction
Py_NewInterpreter()). For my needs, I create many GUI with wxPython
and I have problems. Here is My C Code:

{
    PyEval_InitThreads();
    Py_Initialize();


    PyImport_ImportModule("myModule");//it creates a wxApp object and
a GUI (mainloop)
    ......


    Py_NewInterpreter();
    PyImport_ImportModule("anotherModule");//it should create a new
wxApp and a new GUI (with Mainloop)


    .....
}

Unfortunately this code does not work. In fact, My C application which
use many interpreters is seen by wxPython as a single application, and
as wxPython is thread safe, it is not possible to create a second App.


I have to use many interpreters to separate variables and to avoid
links between modules.

What could I do to create many GUI in different interpreters (each GUI
have to be in a separate environment)???



Thanks.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.wxwidgets.org/pipermail/wxpython-users/attachments/200710=
22/cf8eb144/attachment.htm


More information about the wxpython-users mailing list