```
import tornado
import tornado.httpserver
import tornado.options
import tornado.ioloop
import tornado.options
from tornado.options import define,options
from tornado.web import RequestHandler,url
tornado.options.define("port",type=int,default=8000,help="fuwuduankou")
class IndexHandle(RequestHandler):
def get(self):
# subject = self.get_query_argument("subject")
query_args = self.get_query_arguments("q")
self.write(query_args)
if name == "main":
tornado.options.parse_command_line()
app = tornado.web.Application([(r"/",IndexHandle)],debug=True)
http_server = tornado.httpserver.HTTPServer(app)
http_server.listen(options.port)
tornado.ioloop.IOLoop.current().start()
```
网友评论