__main__.py 文件源码

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

项目:tellsticknet 作者: molobrakos 项目源码 文件源码
def print_event_stream():
    """Print event stream"""
    controllers = discover()

    # for now only care about one controller
    controller = next(controllers, None) or exit('no tellstick devices found')

    if argv[-1] == "raw":
        stream = map(prepend_timestamp, controller.packets())
    else:
        stream = controller.events()

    for packet in stream:
        print(packet)
        try:
            stdout.flush()
        except IOError:
            # broken pipe
            pass
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号