Can a Tkinter GUI check for abort script:

Hendrik van Rooyen mail at microcorp.co.za
Wed Dec 20 00:03:55 EST 2006


 Michael Yanowitz  top posted (again):

>No. test3.py (for example) is just plain Python code that sends and receives
socket data
>from another machine. It does (or could) contain loops that last a long time,
repeating
>the read or write operations to and from the socket. This grabs the CPU.
>   What I am hoping for is a function call I can make, without knowing any of
the
>GUI objects, I can call from test3.py (or while test3.py is running) which will
>refresh the GUI and check for activity such as button presses on the GUI
itself.
>  For example, if I just call sleep(), will it do this?

ok here is the rub - the tkinter gui and the sockets stuff both want to be the
main thread.

You are going to have to run separate processes, and communicate via pipes.

Its a hard nut to chew, but there you have it

- Hendrik




More information about the Python-list mailing list