How do I get key pressed?
<p>I was wondering how do I get a key pressed in python</p>

<p>I tried doing:</p>

<pre><code>import msvcrt as keys
while True:
    key = keys.getch()
    if key == "a":
        print("You have pressed a") 
</code></pre>

<p>Does anyone know how to fix it?</p>
