seg fault

Diez B. Roggisch deetsNOSPAM at
Thu Nov 4 15:39:44 CET 2004

Ajay wrote:

> hi!
> i have some code with a gui that does some processing in another thread,
> say t2.
> when t2 needs to display something on the gui, it generates an event
> (which i have binded earlier). the code runs fine on windows but segfaults
> on linux.
> the point where it segfaults is when it generates the event.
> any ideas why?

Lots of gui-toolkits don't like to be manipulated outside the thread their
main eventloop is running. I don't know this for sure for tk, but your
problem looks like it's the case here.

So I suggest you communicate your event to the main thread using a queue,
and insert the event in tk's event loop somehow. For that you could use
after-calls that periodically check for pending events.


Diez B. Roggisch

More information about the Python-list mailing list