Is it possible to suppress the “Terminated” message that is printed on stderr when the python interpreter receives a SIGTERM signal. I would like it to terminate silently.
I have tried using a different signal, such as SIGINT, but in this cases python prints out the running scripts Traceback and a “KeyboardInterrupt” message.
The “Terminated” is printed by your shell, consult the manual for your shell to find out how to disable it.
As for
SIGINT, you can actually catch this! To avoid printing the Traceback, simply wrap your whole program inor register a Signal handler, as shown here: How do I capture SIGINT in Python?