Recently I came across a problem which I still can't solve on my own. Consider this small example:
import sys import time time.sleep(3) print sys.stdin.flush() input = raw_input('Your input: ') print 'Your input: ', input While the script is sleeping I type in the word 'test1', so that it is printed on the console. Having slept for three seconds the script continues and wants me to type in another word 'test2' and I hit return. The output looks like this: [EMAIL PROTECTED] ~ [ 21:41:27 ] $ python test.py test1 test2 Your input: test1test2 Is there any way to flush the stdin buffer so that 'test1' is _not_ regarded as input? How could one solve this issue? Cheers, Fabian -- http://mail.python.org/mailman/listinfo/python-list