Newbie question involving buffered input

Caolan caolan at ldmf.net
Fri Sep 1 18:31:11 CEST 2006


I am executing the code below on a Windows XP system and if I enter > 2 characters it buffers the input and the call to sys.stdin.flush does not flush the input, it remains buffered.
 
What am I doing wrong here?
 
Thanks,
 
Caolan
 
        try:
            gooberselectX = sys.stdin.read(2)
        except IOError, e:
            print 'error reading from stdin device'
        except KeyboardInterrupt, e:
            print 'you cannot break. please use the \'q\' key to exit'
        else:
            try:
                sys.stdin.flush()
            except IOError, e:
                print 'error flushing buffered input'
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20060901/a710fa39/attachment.html>


More information about the Python-list mailing list