[Tutor] Mainloop conflict

Peter Otten __peter__ at web.de
Fri Jul 29 22:17:13 CEST 2011


Stefan Behnel wrote:

> Christopher King, 29.07.2011 17:08:
>> On Thursday, July 28, 2011, Dave Angel wrote:
>>> On 07/28/2011 08:32 PM, Christopher King wrote:
>>>>
>>>> Dear Tutor Dudes,
>>>>      I have a socket Gui program. The only problem is that socket.recv
>> waits
>>>> for a response, which totally screws Tkinter I think. I tried making
>>>> the timeout extremely small (it was alright if I didn't receive
>>>> anything, I was excepting that a lot) but I think that screwed socket.
>>>> Anyone have
>> words
>>>> of wisdom.
>>>>
>>>> Sincerely,
>>>>      Me
>>>>
>>> Sure:
>>>
>>> Do the socket I/O on a separate thread.
>>
>> I was afraid of that.
> 
> Understandable. However, as I already said, you don't need to do that,
> just go the obvious route.

While searching for

http://effbot.org/zone/tkinter-threads.htm

I stumbled upon

http://effbot.org/pyfaq/can-i-have-tk-events-handled-while-waiting-for-i-o.htm

which looks even simpler indeed.



More information about the Tutor mailing list