def start_bottom_window(window, chat_sender):
window.bkgd(curses.A_NORMAL, curses.color_pair(2))
window.clear()
window.box()
window.refresh()
while True:
window.clear()
window.box()
window.refresh()
s = window.getstr(1, 1).decode('utf-8')
if s is not None and s != "":
chat_sender.send_string(s)
# need to do sleep here...
# if bottom window gets down to `window.getstr...` while top window is setting up,
# it registers a bunch of control characters as the user's input
time.sleep(0.005)
评论列表
文章目录