zmqchat.py 文件源码

python
阅读 22 收藏 0 点赞 0 评论 0

项目:zmq-chat 作者: jnthnwn 项目源码 文件源码
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)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号