If you don’t want to waste 1 hour debugging…

… call gtk.gdk.threads_init() when you want to work with threads in a PyGTK application.

Well, to not leave this post so short, I’ll also refer a post explaning threads on PyGTK which looks quite good (I didn’t look carefuly at it because I already knew 99% of what it says… it’s a pity that because of that I didn’t notice the 1% that I didn’t know and which would have saved me one hour of debugging :/). Also, note that if you write your own __init__ function in order to pass data to the thread you will have to call threading.Thread.__init__(self) somewhere in it.

One Response to “If you don’t want to waste 1 hour debugging…”

  1. Jadd Says:

    Good tip. Threading in PyGTK is a nightmare.

Leave a Reply

If you have an OpenID, you may fill it in here. If your OpenID provider provides a name and email, those values will be used instead of the values here. Learn more about OpenID or find an OpenID provider.