title: How to break this loop in Python by detecting key press
body: <pre><code>from subprocess import call
  try:
      while True:
          call (["raspivid -n -b 2666666.67 -t 5000 -o test.mp4"],shell=True)
          call (["raspivid -n -b 2666666.67 -t 5000 -o test1.mp4"],shell=True)
  except KeyboardInterrupt:
      pass
  </code></pre>
  
  <p>I plan to make it breaking loop while I am pressing <em>any</em> button. However I tried lots of methods to break the and none of them worked.</p>