Tkinter listener thread?

Eric Brunel eric_brunel at
Fri Jan 27 04:03:07 EST 2006

On Thu, 26 Jan 2006 17:32:32 +0000, Steve Holden <steve at>  

> gregarican wrote:
>> I have a Python UDP listener socket that waits for incoming data. The
>> socket runs as an endless loop. I would like to pop the incoming data
>> into an existing Tkinter app that I have created. What's the
>> easiest/most efficient way of handling this? Would I create a separate
>> thread that has the listener set a certain Tkinter variable if there is
>> incoming data? Any suggestions would be tremendously appreciated :-)

There's in fact no need to check regularly if there's something in the  
Queue: the secondary thread can post a tk custom event to trigger the  
treatment automatically from within the main GUI loop. See here:

python -c "print ''.join([chr(154 - ord(c)) for c in  

More information about the Python-list mailing list