shell.py 文件源码

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

项目:networkzero 作者: tjguk 项目源码 文件源码
def main():
    context = zmq.Context()
    socket = context.socket(zmq.REQ)
    socket.connect("tcp://%s:%s" % (config.LISTEN_ON_IP, config.LISTEN_ON_PORT))

    while True:
        command = input("Command: ")
        socket.send(command.encode(config.CODEC))
        response = socket.recv().decode(config.CODEC)
        print("  ... %s" % response)
        words = shlex.split(response.lower())
        status = words[0]
        if len(words) > 1:
            info = words[1:]
        if status == "finished":
            print("Finished status received from robot")
            break
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号