2

I have to validate user-input from stdin that is not going to be entered by hitting the Enter-key. So readline() and other Enter-dependent functions are of no use to me.

Practically the promt will be filled, and each keystroke has to be handled as an event. How do I get access to the promt buffer's contents?

2 Answers 2

2

I'm unclear what you mean by "prompt", but it sounds like you need to respond to individual key-presses, rather than textual input.

This is covered in the Python FAQ under "How do I get a single keypress at a time?"

Sign up to request clarification or add additional context in comments.

Comments

2

See if it helps

http://code.activestate.com/recipes/134892/

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.