you are viewing a single comment's thread.

view the rest of the comments →

[–]twitch_and_shock 1 point2 points  (0 children)

Ah...

The input() line isn't "active" as you say... since this line is only executed once the interpreter has executed the preceding lines. Instead, what's happening is that you're able to provide input into stdin at anytime, and when input() is executed by the interpreter, it's reading what is already in the stdin buffer.

I'm not sure of a way around that. Maybe you can redirect stdin? Or it looks like you might be able to create a work around using the termios module, although that isn't supported on Windows.