首页 > 其他 > 详细

tornado

时间:2018-01-16 20:55:20      阅读:167      评论:0      收藏:0      [点我收藏+]

s1.py

import tornado.ioloop
import tornado.web

class MainHandler(tornado.web.RequestHandler):
    def get(self):
        self.render(s1.html)
settings={
    template_path:tpl,
    static_path: static,
}
application = tornado.web.Application([
    (r"/index", MainHandler),
],**settings)

if __name__ == "__main__":
    application.listen(8888)
    tornado.ioloop.IOLoop.instance().start()

tpl s1.html

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <link rel="stylesheet" href="static/s1.css">
</head>
<body>
<h1 class="w">111</h1>
</body>
</html>

static s1.css

 .w{
            color: aqua;
        }

快速上手tornado

tornado

原文:https://www.cnblogs.com/koushuige/p/8297719.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!