def get_gpa(xh): """ 提供学号 返回学分基点 """ gpa_obj = GPA(xh) gpa_obj.getscore_page() gpa = gpa_obj.get_gpa()#["ave_score"] return gpa
def get_gpa(xh): """ 提供学号 返回学分基点 """ gpa_obj = GPA(xh) gpa_obj.getscore_page() gpa = gpa_obj.get_gpa() #["ave_score"] return gpa
def POST(self): data = web.input() try: xh = data.xh except AttributeError: return json_err("The id is xh") gpa = GPA(xh) gpa.getscore_page() result = gpa.get_gpa() if result == -1: return json_err("can not find your xh") result = json.dumps(result) return result