How is the window being closed? By someone forcing it to close? Or terminating the process? If someone is just closing the window you can setup an atexit handler that will close the socket before it finishes. However, if the process is being terminated, then you will have to use one of the other options. If that's the only way you have to close the program then you will definitely need a flag of some sort. I've been known to play all sorts of tricks. Most nastiest of which includes creating a file in a particular directory that the program periodically polls. Don't do this. Use threads. Or a non-blocking keypress or something. _______________________________________________
Tutor maillist  -  [email protected]
http://mail.python.org/mailman/listinfo/tutor

Reply via email to