flask based on tornado

from flask import Flask
from tornado.wsgi import WSGIContainer
from tornado.httpserver import HTTPServer
from tornado.ioloop import IOLoop

app = Flask(__name__)

@app.route("/")
def hello(): 
  return "Hello World!" 

if __name__ == "__main__": 
  http_server=HTTPServer(WSGIContainer(app))
  http_server.listen(8000)
  IOLoop.instance().start()

  

  

posted @ 2019-04-13 15:15  琵琶真的行  阅读(177)  评论(0编辑  收藏  举报