CLEAR INPUT BUFFER

Sam z.sam-No-Spam- at libero.it
Thu Oct 28 11:51:19 CEST 2004


Good day!

I have a problem with Python and the input buffer.
My application must read a barcode from PS2 and then
process it.
The problem is: i have to discard all
characters inserted in buffer while Elaborate(data)
is running.
I tried to clear the buffer using sys.stdin.flush() but
it seem not work.

proc Principale() :
  while True
    # sys.stdin.flush()
    data = sys.stdin.readline()
    Elaborate(data)


proc Elaborate() :
  sleep(5)


I'll apreciate any help!
Thanks





More information about the Python-list mailing list