def atLogin(self): user = self.userEdit.text() password = self.passEdit.text() try: self.zxw = Zhixuewang(user, password) except UserOrPassError as e: self.loginErrLabel.show() else: self.loginErrLabel.hide() self.initExamList()
def check(self, Dialog_Login): user = str(self.textID.text()) pswd = str(self.textPassword.text()) try: zxw = Zhixuewang(user, pswd) except Exception as e: print("ERROR:" + str(e)) #TODO:Destroy this window self.form2 = QtWidgets.QMainWindow() self.m = mainWindow.Ui_MainWindow(zxw) self.m.setupUi(self.form2) self.form2.show()
def clear_screen(): os_version = platform.platform() if os_version[0] == 'W': os.system('cls') else: os.system('clear') print('Init finish. Wait for input.') zxw = None while zxw == None: print('Exec login subprogramme') user = input('User Name: ') password = getpass() try: zxw = Zhixuewang(user, password) except UserOrPassError as e: print('User name or password error.') print('Login successfully.') op = 1 exams = None while op != 2: is_vaild_exam_num = False choosen_examnum = -1 while not is_vaild_exam_num: clear_screen() if exams == None: exams = zxw.get_exams() for i, exam in enumerate(exams): print(f'{i}. {exam.examName}')
from zhixuewang import Zhixuewang username = input("请输入用户名:") password = input("请输入密码:") zxw = Zhixuewang(username=username, password=password) for examData in zxw.get_exams(): print(examData.examId) print(examData.examName) # print(response.json()) # # print("%s:" % grades.pop("examName")) # # # # # # for k, v in grades.items(): # # print("%s:\n\t分数:%s" % (k, v.score)) # # print("\t班级最高分:%s" % v.classRank.highScore) # # print("\t班级平均分:%s" % v.classRank.avgScore) # # print("\t班级排名:%s" % v.classRank.rank) # # print("\t年级平均分:%s" % v.gradeRank.avgScore) # # print("\t年级最高分:%s" % v.gradeRank.highScore) # # # #