[Tutor] signal trapping in a class instance

Chris Fuller cfuller084 at thinkingplanet.net
Sun Mar 16 01:17:09 CET 2008


SIGKILL is not trappable.  You probably want SIGTERM.  Furthermore, this 
signal will be sent to the process, not some thread or class instance within 
a process.

Maybe you need some other mechanism?  Is the signal going to be from the same 
python process?  If so, just call it directly.  Otherwise, there are a great 
deal of other interprocess communications options.  Sockets are probably the 
most cross platform nd widely understood.  Check out the UDPServer class in 
the standard library.

You'd need to write a client script to send the commands, but this is trivial 
once you have the server set up.

Cheers



More information about the Tutor mailing list