How to refresh curses window correctly?

前端 未结 3 2265
遇见更好的自我
遇见更好的自我 2021-02-14 00:00
while 1:
    ...
    window.addstr(0, 0, \'abcd\')
    window.refresh()
    ...

window size is full terminal size, big enough to hold

3条回答
  •  生来不讨喜
    2021-02-14 00:21

    addstr() only prints the string you specify, it does not clear the following characters. You will have to do that yourself:

    • To clear characters until the end of the line, use clrtoeol(),

    • To clear characters until the end of the window, use clrtobot().

提交回复
热议问题