[pygtk] Can't run PyGTK more than once from embedded Python
Romain Behar
romainbehar at yahoo.com
Mon Jan 9 22:12:54 WST 2006
I've finally found the bug: to run PyGTK scripts
properly, one has to create only one Python
interpreter and use it to launch all scripts. My
application was creating a new interpreter each time
it ran a new script.
The attached example showcases the bug (if it really
is). It runs a simple PyGTK script three times, the
first two with the same interpreter (which work
properly), the third script with a new interpreter
which outputs the following error:
Traceback (most recent call last):
File "<string>", line 3, in ?
File
"/usr/lib/python2.4/site-packages/gtk-2.0/gtk/__init__.py",
line 38, in ?
import gdk # this is created by the _gtk import
ImportError: No module named gdk
Cheers,
Romain
> You probably don't want to unload or call
> Py_Finalize. It would be helpful to have
> a minimal test case so we can see exactly
> what you're doing and so that others can
> reproduce the problem.
>
> John
>
__________________________________________
Yahoo! DSL Something to write home about.
Just $16.99/mo. or less.
dsl.yahoo.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: pygtk-test.c
Type: text/x-csrc
Size: 1330 bytes
Desc: 619935062-pygtk-test.c
Url : http://www.daa.com.au/pipermail/pygtk/attachments/20060109/2bdf7bbf/pygtk-test.c
More information about the pygtk
mailing list