您的位置:首页 > 其它

创建tornado应用输出hello world

2016-05-19 21:59 387 查看
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()


tornado下载地址

tornado安装

pip
install tornado

tar
xvzf tornado-4.3.tar.gz

cd
tornado-4.3

python
setup.py build

sudo
python setup.py install
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: