title: Why is signal.SIGALRM not working in Python on windows?
body: <p>I'm trying to understand OS concepts and Python libraries.</p>
  
  <p>I came across a specific example mentioned in Python documentation <a href="https://docs.python.org/3/library/signal.html" rel="noreferrer">https://docs.python.org/3/library/signal.html</a> link which is not working for me on Windows.</p>
  
  <pre><code>import signal, os
  
  def handler(signum, frame):
      print('Signal handler called with signal', signum)
      raise OSError("Couldn't open device!")
  
  # Set the signal handler and a 5-second alarm
  signal.signal(signal.SIGALRM, handler)
  signal.alarm(5)
  # This open() may hang indefinitely
  fd = os.open('/dev/ttyS0', os.O_RDWR)
  
  signal.alarm(0)          # Disable the alarm
  </code></pre>
  
  <p>Is there any specific reason why singal.SIGALRM is not working on windows?</p>
  
  <p>Auto complete is even showing the SIGALRM in Pycharm IDE (I'm assuming that there will be a variable or function if it shows like that). </p>
  
  <p>But when I run the program, it is giving me the below error on Windows. I haven't checked this on Linux.</p>
  
  <pre><code>Traceback (most recent call last):
    File "C:/Users/preddy53/Desktop/syst.py", line 8, in &lt;module&gt;
      signal.signal(signal.SIGALRM, handler)
  AttributeError: module 'signal' has no attribute 'SIGALRM'
  </code></pre>
  
  <p>Where am I doing wrong? Is it specific to operating system only?</p>