title: Play Sound whenever key is pressed in Python
body: <p>I am writing a Python script wherein everytime a key is pressed, a sound is played. 
  I am using the Winsound module to play the sound, and I want something like this:</p>
  
  <pre><code>import winsound
  
  while True:
      if any_key_is_being_pressed: # Replace this with an actual if statement.
          winsound.PlaySound("sound.wav", winsound.SND_ASYNC)
  
  # rest of the script goes here...
  </code></pre>
  
  <p>However, I don't want the "While True" block pausing the script when it is being run. 
  I want it to run in the background and let the script carry on being executed, if this is even possible in Python.</p>
  
  <p>Perhaps I am barking up the wrong tree and don't need a while true; if there is any way to play sound when <em>any</em> keyboard key is pressed, then please tell me.</p>
  
  <p>Thank you.</p>