猫史档案馆


聊天机器人

用户:四九圣尊四九圣尊查看:0 回复:1 评论:0 创建时间:2017-10-15T12:06:53


import requests

a = 1

s1 = input("对话题目:")

while a == 1:

    message = requests.post("http://www.tuling123.com/openapi/api",

    data = {"key":"73f46863ca3e44df8b1192ae70a62d10",

    "info":s1}

    )

    reply = message.json()

    print("XX:"+reply['text'])

    

    s2 = reply['text']

    message = requests.post("http://www.tuling123.com/openapi/api",

    data = {"key":"73f46863ca3e44df8b1192ae70a62d10",

    "info":s2}

    )

    reply = message.json()

    print("XX:"+reply['text'])

    s1 = reply['text']

    s3 = reply['text']

    message = requests.post("http://www.tuling123.com/openapi/api",

    data = {"key":"73f46863ca3e44df8b1192ae70a62d10",

    "info":s3}

    )

    reply = message.json()

    print("XX:"+reply['text'])

    s1 = reply['text']

    s4 = reply['text']

    message = requests.post("http://www.tuling123.com/openapi/api",

    data = {"key":"73f46863ca3e44df8b1192ae70a62d10",

    "info":s4}

    )

    reply = message.json()

    print("XX"):"+reply['text'])

    s1 = reply['text']

    s5 = reply['text']

    message = requests.post("http://www.tuling123.com/openapi/api",

    data = {"key":"73f46863ca3e44df8b1192ae70a62d10",

    "info":s5}

    )

    reply = message.json()

    print("XX:"+reply['text'])

    s1 = reply['text']

    s6 = reply['text']

    message = requests.post("http://www.tuling123.com/openapi/api",

    data = {"key":"73f46863ca3e44df8b1192ae70a62d10",

    "info":s5}

    )

    reply = message.json()

    print("XX:"+reply['text'])

    s1 = reply['text']

笑喷了!



回复

上一页1 页 / 共 1下一页
杰鸽杰鸽

https://www.zhihu.com/question/28283196


点赞0


评论