Hello world for tornado
时间:2011-04-01 来源:Ray Z
1 import tornado.ioloop
2 import tornado.web
3
4 class MainHandler(tornado.web.RequestHandler):
5 def get(self):
6 self.write("hello world")
7
8 application = tornado.web.Application([(r"/", MainHandler),])
9
10 if __name__ == "__main__":
11 application.listen(8888)
12 tornado.ioloop.IOLoop.instance().start()
2 import tornado.web
3
4 class MainHandler(tornado.web.RequestHandler):
5 def get(self):
6 self.write("hello world")
7
8 application = tornado.web.Application([(r"/", MainHandler),])
9
10 if __name__ == "__main__":
11 application.listen(8888)
12 tornado.ioloop.IOLoop.instance().start()
相关阅读 更多 +