Linux : python : clear input buffer before raw_input()

后端 未结 2 1632
生来不讨喜
生来不讨喜 2020-12-06 18:54

I have looked at a few thread about this, but it doesn\'t seem to solve my problem. I am running linux and when I use raw_input(), with a pause between each, it will take th

2条回答
  •  孤街浪徒
    2020-12-06 19:25

    Use keypress getch class of tty (linux) and msvcrt (windows) and use sys.stdout.flush() function to flush the buffer

提交回复
热议问题