import urllib.parse
import requests
#调用机器人接口
def qingyunke(msg):
url = "http://api.qingyunke.com/api.php?key=free&appid=0&msg=%s" % (urllib.parse.quote(msg))
html = requests.get(url)
return html.json()["content"]
msg = "翻译i love you"
print(msg)
print(qingyunke(msg))
标签:人工智能,DEMO,urllib,parse,msg,api,聊天,qingyunke
From: https://www.cnblogs.com/djl-0628/p/17000006.html