I want to have it so that each time I hit the space bar, the number in the terminal increases by one, so that I can keep a number in my head and not forget it. However, if I use raw_input for this, I have to hit enter each time, which is annoying. How can I make it so that I build a counter that increases a variable by one each time the space bar is pressed?
Here is what I have.
x=0
while x<10000000:
press = raw_input()
if press == "z":
x=x+1
print x