runners.py 文件源码

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

项目:transpyler 作者: Transpyler 项目源码 文件源码
def start_qt_scene_app_subprocess():
    """
    Starts a remote sub-process that initializes a TurtleScene widget and Qt's
    mainloop.
    """

    inbox = MailboxState.inbox = Queue()
    outbox = MailboxState.outbox = Queue()
    process = Process(target=start_qt_scene_app,
                      kwargs=dict(outbox=outbox, inbox=inbox, ping=True),
                      name='turtle-server')
    process.daemon = True
    process.start()

    # Send a ping message to the out process
    outbox.put(['ping'])
    msg = inbox.get(timeout=2.0)
    if msg != ['ping']:
        raise RuntimeError('wrong response from server: %s' % (msg,))

    return process
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号