title: How can I send a signal from a python program?
body: <p>I have this code which listens to USR1 signals</p>
  
  <pre><code>import signal
  import os
  import time
  
  def receive_signal(signum, stack):
      print 'Received:', signum
  
  signal.signal(signal.SIGUSR1, receive_signal)
  signal.signal(signal.SIGUSR2, receive_signal)
  
  print 'My PID is:', os.getpid()
  
  while True:
      print 'Waiting...'
      time.sleep(3)
  </code></pre>
  
  <p>This works when I send signals with <code>kill -USR1 pid</code></p>
  
  <p>But how can I send the same signal from within the above python script so that after 10 seconds it automatically sends <code>USR1</code> and also receives it , without me having to open two terminals to check it?</p>