Tornado的学习
上一篇 /
下一篇 2014-02-12 13:32:48
/ 个人分类:Python
http://www.tornadoweb.org/en/stable/
https://github.com/facebook/tornado
http://www.pythoner.com/273.html
1.安装python和Tornado,具体的看http://www.tornadoweb.cn/
2.新建一个 helloworld.pyHere is a simple “Hello, world” example app:
import tornado.ioloop
import tornado.web
class MainHandler(tornado.web.RequestHandler):
def get(self):
self.write("Hello, world")
if __name__ == "__main__":
application = tornado.web.Application([
(r"/", MainHandler),
])
application.listen(8888)
tornado.ioloop.IOLoop.instance().start()
3.运行该脚本
4.打开 http://localhost:8888/就能看到Hello, world
收藏
举报
TAG: