def main(): app = QtGui.QApplication(sys.argv) while True: isExit = True log_win = Login_Window() log_win.show() app.exec_() #get username and password sign = log_win.getAccessLevel() name = log_win.getUsername() flag = 0 if sign == 1 or sign == 2: flag = Navi_dialog(sign).exec_() if flag == 1: window = Admin_window(name) window.show() app.exec_() isExit = window.num elif flag == 2: window = Teacher_window(name) window.show() app.exec_() isExit = window.num if (isExit): break
def main(): app = QtGui.QApplication(sys.argv) flag = Login_Window().exec_() global name if flag == 1: from Admin import Admin_window window = Admin_window() window.show() sys.exit(app.exec_()) elif flag == 2: from Teacher import Teacher_window window = Teacher_window() window.show() sys.exit(app.exec_())