Python Tornado
时间:2014-06-28 12:32:53
收藏:0
阅读:238
按照http://www.tornadoweb.cn/所提供的方法下载安装后编写如下程序:
import tornado.ioloop
import tornado.web
class MainHandler(tornado.web.RequestHandler):
def get(self):
self.write("Hello, world")
class TestHandler(tornado.web.RequestHandler):
def get(self):
self.write("Hello Evilxr,This is you‘s Python!")
application = tornado.web.Application([
(r"/", MainHandler),
(r"/test",TestHandler),
])
if __name__ == "__main__":
application.listen(8888)
tornado.ioloop.IOLoop.instance().start()
退出VI 后运行该脚本 root@IdeaPad:~/test# python one.py


评论(0)