# -*- coding:utf-8 -*- import requests import json import sys reload(sys) sys.setdefaultencoding('utf-8') def main(): order = "something" while True: order = raw_input(">> Q: ") if len(order) == 0: break data = '{"key": "key","info":"'+order+'"}' r = requests.post("http://www.tuling123.com/openapi/api", data=data) print ">> A: " + str(json.loads(str(r.text))['text']) if __name__ == "__main__": main()