Romain Behar wrote:
Unfortunately, it's not possible to have a single
interpreter. For example, more than one document can
be opened and each of them can have an interpreter
instance. Every other Python library tested works
properly with multiple interpreters.
That's because those libraries don't have much/any global state and
independently executing threads. UI libraries are a different ball of wax.
'pygtk' module
doesn't complain, only 'gtk' one does. If the issue
comes from the gtk extension modules being initialized
multiple times, I'll add a bug to the tracker.
Careful. What you are doing is ... unusual, at least.
Having multiple pygtk instances means that you have multiple Gtk event
loops. This is not good. You are going to have weird problems in the
UI event systems (things like cut and paste between windows, close
systems, etc.).
You really might want to rethink this architecture.
You might want to make a global Python interpreter which initializes and
then calls your current C code as an extension module. Then, the C code
can call *back* into the global Python interpreter when it needs Python.
It shouldn't be that much extra code and it means that you don't have to
rewrite the entire application.
-a
_______________________________________________
pygtk mailing list [email protected]
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/