Simply "import signal", and see documention of that module. But bear in mind that signals are weird with Python.
The atomic unit of Python execution can span a C external function
call, and that can take an indefinitely long time. So delivery of
signals at the Python level can be delayed.