How to handle a HTTP GET request to a file in Tornado?
问题 I'm using Ubuntu and have a directory called "webchat", under this directory there are 4 files: webchat.py, webchat.css, webchat.html, webchat.js. When creating a HTTP server using Tornado, i map the root ("/") to my python code: 'webchat.py' as follow: import os,sys import tornado.ioloop import tornado.web import tornado.httpserver #http server for webchat class webchat(tornado.web.RequestHandler): def get(self): self.write("Hello, chatter! [GET]") def post(self): self.write("Hello, chatter!