title: Get signal names from numbers in Python
body: <p>Is there a way to map a signal number (e.g. signal.SIGINT) to its respective name (i.e. "SIGINT")?</p>
  
  <p>I'd like to be able to print the name of a signal in the log when I receive it, however I cannot find a map from signal numbers to names in Python, i.e.:</p>
  
  <pre><code>import signal
  def signal_handler(signum, frame):
      logging.debug("Received signal (%s)" % sig_names[signum])
  
  signal.signal(signal.SIGINT, signal_handler)
  </code></pre>
  
  <p>For some dictionary sig_names, so when the process receives SIGINT it prints:</p>
  
  <pre><code>Received signal (SIGINT)
  </code></pre>