分享一下我老师大神的人工智能教程!零基础,通俗易懂!http://blog.csdn.net/jiangjunshow
也欢迎大家转载本篇文章。分享知识,造福人民,实现我们中华民族伟大复兴!
# !/usr/bin/env python# -*- coding: utf-8 -*-from flask import Flask,requestfrom lib.Mojo.Client import *import chardetapp = Flask(__name__)##装饰器作用,是做一个URL与视图函数的映射@app.route('/api/SMSinfo/')def sms(): message = request.args.get('message') print message print '----------------' print type(message) print len(message) print '----------------' phone=request.args.get('phone') print phone a=New() a.LoadDB(message,phone); return message+str(phone)#print phone# return {"param":request.args.get('abc')}if __name__ == '__main__': app.run(host='0.0.0.0',port=6001,debug=True) [root@yyjk flask]# python mojo.py * Running on http://0.0.0.0:6001/ (Press CTRL+C to quit) * Restarting with stat * Debugger is active! * Debugger PIN: 677-847-682中国----------------<type 'unicode'>2----------------1234567lib.Mojo.Client<lib.Mojo.Client.New object at 0x7fe80383ff50>2017-11-13 09:36:43.005064{'phone': u'1234567', 'message': u'\u4e2d\u56fd', 'stime': datetime.datetime(2017, 11, 13, 9, 36, 43, 5064)}10.5.100.232 - - [13/Nov/2017 09:36:43] "GET /api/SMSinfo/?message=中国&phone=1234567 HTTP/1.1" 200 -