title: Stop an infinite while loop repeatedly invoking os.system
body: <p>Thank you guys for seeing my post.</p>
  
  <p>First, the following is my code:</p>
  
  <pre><code>import os
  
  print("You can create your own message for alarm.")
  user_message = input("&gt;&gt; ")
  
  print("\n&lt;&lt; Sample alarm sound &gt;&gt;")
  
  for time in range(0, 3):
      os.system('say ' + user_message) # this code makes sound.
  
  print("\nOkay, The alarm has been set.")
  
  """
  ##### My problem is here #####
  ##### THIS IS NOT STOPPED #####
  
  while True:
      try:
          os.system('say ' + user_message)
      except KeyboardInterrupt:
          print("Alarm stopped")
          exit(0)
  """
  </code></pre>
  
  <p>My problem is that <strong>Ctrl + C does not work!</strong></p>
  
  <p>I tried changing position of <code>try</code> block, and making signal(SIGINT) catching function.</p>
  
  <p>But those also does not work.</p>
  
  <p>I have seen <a href="https://stackoverflow.com/a/8335212/5247212">https://stackoverflow.com/a/8335212/5247212</a>, <a href="https://stackoverflow.com/a/32923070/5247212">https://stackoverflow.com/a/32923070/5247212</a>, and other several answers about this problem.</p>
  
  <p>I am using MAC OS(10.12.3) and python 3.5.2.</p>