remove last STDOUT line in Python

后端 未结 5 751
温柔的废话
温柔的废话 2020-11-28 11:17

I am trying to figure out how to suppress the display of user input on stdout.

raw_input() followed by any print statement preserves what the user typed

5条回答
  •  萌比男神i
    2020-11-28 11:27

    Give this a try:

    CURSOR_UP = '\033[F'
    ERASE_LINE = '\033[K'
    print(CURSOR_UP + ERASE_LINE)
    

提交回复
热议问题