class MainHandler(tornado.web.RequestHandler): def get(self): self.render("index.html",page_title="Price Draw Activity",) # 获得抽奖设置信息 def post(self): total1=self.get_argument('total1') total2 = self.get_argument('total2') total3 = self.get_argument('total3') # member_str=self.get_argument("members") total_size["1"]=int(total1) if total1 else 1 total_size["2"] = int(total2) if total2 else 1 total_size["3"] = int(total3) if total3 else 1 rest_size["1"]=total_size["1"]-price_size["1"] rest_size["2"] = total_size["2"] - price_size["2"] rest_size["3"] = total_size["3"] - price_size["3"] global member_str member_str=self.get_argument("members") self.redirect('/getmembers')
tornado.options.parse_command_line()server=tornado.httpserver.HTTPServer(Application())server.listen(8000)tornado.ioloop.IOLoop.instance().start()
评论