高性能web服务器框架Tornado简单实现restful接口及开发实例 http://HdhCmsTestarticle/52209.htm
要使用它,必须按照以下套件:
1)Python(建议使用Python 2.5 / Python 2.6)
2)Simplejson(建议使用simplejson 2.0.9)
3)cURL(建议使用curl 7.19.7或以上版本)
4)Pycurl(建议使用pycurl 7.16.2.1)
5)Tornado Web Server(这才是主角,版本就照官网上最新的安装吧)
一个最简单的服务:
import tornado.ioloop import tornado.web class MainHandler(tornado.web.RequestHandler): def get(self): self.write("Hello, world") application = tornado.web.Application([ (r"/", MainHandler), ]) if __name__ == "__main__": application.listen(8888) tornado.ioloop.IOLoop.instance().start()
查看更多关于Web服务器框架Tornado简介的详细内容...
声明:本文来自网络,不代表【好得很程序员自学网】立场,转载请注明出处:http://haodehen.cn/did87670