title: Confusion over time.sleep in Python "while True" loop
body: <p>Level beginner
  I am using python 2.7 version on ubuntu.
  I have a confusion regarding a small code snippet in python. I know that <code>while True</code> in python means to loop infinitely. I have the following code:</p>
  
  <pre><code>#!/usr/bin/env python
  import signal
  import time
  
  def ctrlc_catcher(signum, frm):
       print "Process can't be killed with ctrl-c!"
  
  def alarm_catcher(signum,frame):
      print "Got an alarm"
  
  
  signal.signal(signal.SIGINT, ctrlc_catcher)
  signal.signal(signal.SIGALRM, alarm_catcher)
  
  
  while True:
     signal.alarm(1)
     pass
  </code></pre>
  
  <p>When I execute the programm the output is blank, when I hit Ctrl-C key it displays "Process can't be....." message.
  My question is why the <code>signal.alarm(1)</code> is not working ?
  However if I put a small pause using</p>
  
  <pre><code>while True:
     signal.alarm(1)
     time.sleep(1)
     pass
  </code></pre>
  
  <p>after it then the alarm gets triggered and in the output screen I see "Got an alarm" message after every second.
  What is time.sleep(1) doing so that the alarm gets triggered? 
  Thanks</p>