def run(self): flogin = LogIn() ########################################################################## for username in self.userID: time.sleep(0.1) # print username self.ID_copy.remove(username) if username in self.ID.keys(): continue log = flogin.run(username=username, pwd=self.pwd) if log == 'success': f = open('./ucasID.txt', 'a') f.writelines(username + '\t' + self.pwd + '\n') f.close() logout() print username np.save('./data/ALLid.npy', np.array(self.ID_copy))
screen = LogIn("Welcome to nCursy mySQL") result = screen.authenticate() if result[0] == True: connected = True connection = result[1] else: #I think here should be a function that handles the various errors #by calling a Popup with the appropriate message #For example, 1045 is username/password not good #The error message is in result[1] Popup("There was an error logging in").anyKey() screen = WelcomeScreen() database_name = screen.run(connection) #WelcomeScreen.run() returns a string of a database to use while connected: screen = Menu(database_name) option = screen.mainMenu() c = commandSQL.CommandSQL(connection) if option == 1: #view tables screen = TableScreen(connection) screen.run() if option == 2: #Create Table curses.curs_set(1) c.createTable(screen) if option == 3: #Add Row screen = TableScreen(connection, insertFlag=True) screen.run() if option == 4: #Drop Table