若是用於web訪問,選擇python-web。 其餘,可選python-worker。python
import tornado.wsgi import tornado.web class MainHandler(tornado.web.RequestHandler): def __init__ (self): self.write( " Welcome to Tornado website. " ) app = tornado.wsgi.WSGIApplication([ (r " / " , MainHandler), ]) from bae.core.wsgi import WSGIApplication application = WSGIApplication(app)