import tornado.ioloop
import tornado.web
class MainHandler(tornado.web.RequestHandler):
def get(self):
return "Hello, world"
application = tornado.web.Application([
(r"/", MainHandler),
])
if __name__ == "__main__":
application.listen(8888)
tornado.ioloop.IOLoop.instance().start()
当我写 return 而不是 self.write 它给了我一个错误
Traceback (most recent call last):
File "/home/nishant-un/env/local/lib/python2.7/site-packages/tornado/web.py", line 1155, in _when_complete
raise ValueError("Expected Future or None, got %r" % result)
ValueError: Expected Future or None, got 'Hello, world'
它不明白这究竟是什么Values Error
意思
我正在使用龙卷风 3.1.1