tornado -- hello world
import tornado.ioloop import tornado.web # 编写视图 class MainHandler(tornado.web.RequestHandler): def get(self): self.write("Hello, world") def make_app(): # 配置路由 return tornado.web.Application([ (r"/", MainHandler), ]) if __name__ == "__main__": app = make_app() # 监听端口 app.listen(8888) # 启动 tornado.ioloop.IOLoop.current().start()