while 1: ... window.addstr(0, 0, \'abcd\') window.refresh() ...
window size is full terminal size, big enough to hold
window
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().