title: Trying to make a simple drum machine with Python, how would I get it to make some noise?
body: <p>I'm currently trying to make a drum machine using Python. I want have it so it plays a sound when the user presses a key.</p>
  
  <p>Using the msvcrt model, I got the it to recognize keypresses but I'm wondering how I'll get to it make some noise after that.</p>
  
  <p>Here's my current code:</p>
  
  <pre><code>from msvcrt import getch
      while True:
          key= ord(getch())
          if key == 27: #the esc key
          break
          if key == 113: #the w key
              #play sound
  </code></pre>
  
  <p>Now how would I get around doing this? Is there a specific module I can use for things like this or would I have to make it so it plays downloaded files upon pressing the corresponding key?</p>