asyncio_socket_server.py 文件源码

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

项目:Adwear 作者: Uberi 项目源码 文件源码
def build_widgets():
    input1 = urwid.Edit('What is your name? ')
    input2 = urwid.Edit('What is your quest? ')
    input3 = urwid.Edit('What is the capital of Assyria? ')
    inputs = [input1, input2, input3]

    def update_clock(widget_ref):
        widget = widget_ref()
        if not widget:
            # widget is dead; the main loop must've been destroyed
            return

        widget.set_text(datetime.now().isoformat())

        # Schedule us to update the clock again in one second
        loop.call_later(1, update_clock, widget_ref)

    clock = urwid.Text('')
    update_clock(weakref.ref(clock))

    return urwid.Filler(urwid.Pile([clock] + inputs), 'top')
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号