def Choose(choose): choose = int(input("Choose: ")) with open('menu.json', 'r') as json_file: content = json.load(json_file) pairs = content.items() counter = 1 for key, value in pairs: #print(str(counter) + ". " + "Food: "+ key," - Price: "+ value) if choose == counter: print("Your order is " + key + " with a price of " + value) print("1. Payoff\n2. Cancel") select = input() if select == "1": pass elif select == "2": Menu() if choose == 0: data_login = open("data_login.txt", "r") content = data_login.read() if content != "False": login.login_page(username=content, password="******") elif content == "False": options.welcome(selection="") counter += 1
def main_page(client_socket): global logedin_user logedin_user = login.login_page(client_socket, "C") while True: os.system('clear') print("\nHello, " + '\033[1;3;92m' + logedin_user + '\033[0m') print("\n************ Menu ************\n") print( '\n1. Balance Information\n2. Statement\n3. Transfer Money\n4. Change Password\n5. Logout' ) selection = input('Select from above options : ') if selection == '1' or selection == '2' or selection == '3' or selection == '4': client_socket.send(str.encode(selection)) if int(selection) == customer_request['BALANCE_INFO']: balance_info(client_socket) elif int(selection) == customer_request['STATEMENT']: bank_statement(client_socket) elif int(selection) == customer_request['TRANSFER_MONEY']: transfer_money(client_socket) elif int(selection) == customer_request['CHANGE_PASSWORD']: change_password(client_socket) continue elif selection == '5': client_socket.send(str.encode("0")) break else: print('\033[1;3m' + 'Choose correct option......\n\n' + '\033[0m') continue return
def login(role = None, page = None): if page == None: if (has_access(request.remote_addr, Admin)): return redirect("/adminHome") if (has_access(request.remote_addr, Student)): return redirect("/studentHome") if (has_access(request.remote_addr, Staff)): return redirect("/staffHome") update(request.remote_addr) return login_page(request, role, page)
def check(): answer = login_page() if answer[0] == 1: name = user_page(answer[1]) personal_books = person_recommend_page(answer[1]) return render_template('user.html', uname=name, p_books=personal_books, id_u=answer[1][0][0]) else: return render_template('login.html')
def welcome(selection): print( "\nWelcome to the JunkFood Delivery!\n1. Login\n2. Register\n3. Menu\n0. Exit" ) selection = 0 try: selection = input() selection = int(selection) except ValueError: print("Please enter the number in the list") if selection == 1: login.login_page(username="", password="") if selection == 2: register.register_user(user="", password="") if selection == 3: menu.Menu() if selection == 0: print("ByeBye!") quit() return selection
def main_page(client_socket): global logedin_user logedin_user = login.login_page(client_socket, "T") while True: os.system('clear') print("\nHello, " + '\033[1;3;92m' + logedin_user + '\033[0m') print("\n******************* Menu *******************\n") print( '\n1. Open account\n2. Close account\n3. Deposit for Customer\n4. Withdraw for Customer\n5. Display Customer details\n6. Modify Customer details\n7. Logout\n' ) selection = input('Select from above options : ') if selection == '1' or selection == '2' or selection == '3' or selection == '4' or selection == '5' or selection == '6': client_socket.send(str.encode(selection)) if int(selection) == actions['OPEN_ACCNT']: open_account(client_socket) elif int(selection) == actions['CLOSE_ACCNT']: close_account(client_socket) elif int(selection) == actions['DEPOSIT']: deposit(client_socket) elif int(selection) == actions['WITHDRAW']: withdraw(client_socket) elif int(selection) == actions['MODIFY']: modify_customer_details(client_socket) elif int(selection) == actions['DISPLAY_DETAILS']: display_customer_details(client_socket) continue elif selection == '7': client_socket.send(str.encode('0')) break else: print('\033[1;3m' + 'Choose correct option......\n\n' + '\033[0m') continue return
def main_page(client_socket): global logedin_user logedin_user = login.login_page(client_socket, "A") while True: os.system('clear') print("\nHello, " + '\033[1;3;92m' + logedin_user + '\033[0m') print("\n******************* Menu *******************\n") print( '\n1. Add Teller\n2. Delete Teller\n3. Display Tellers\n4. Display Customer Details\n5. Check Pending Requests\n6. Logout ' ) selection = input('\nSelect from above options : ') if selection == '1' or selection == '2' or selection == '3' or selection == '4' or selection == '5': client_socket.send(str.encode(selection)) if int(selection) == actions['ADD_TELLER']: add_teller(client_socket) elif int(selection) == actions['DELETE_TELLER']: delete_teller(client_socket) elif int(selection) == actions['DISPLAY TELLER']: display_teller(client_socket) elif int(selection) == actions['DISPLAY_DETAILS']: display_bank_details(client_socket) elif int(selection) == actions['PENDING_REQUESTS']: check_pending_requests(client_socket) continue elif selection == '6': client_socket.send(str.encode("0")) break else: print('\033[1;3m' + 'Choose correct option......\n\n' + '\033[0m') continue return
import login import Teacher import Student import unittest import appJar from appJar import gui from Tkinter import * import atexit import os from subprocess import call import Tkinter as tk import tkFont class mytests(unittest.TestCase): def test_checkCourses(self): self.assertEqual(obj.click(app),True) def test_Window_Deletion(self): self.assertEqual(obj.end(app), True) if __name__ == '__main__': app = gui("600x500") name = "Shumail" obj = login.login_page(app) unittest.main(verbosity=10)
print("Record Delete successfully in table") self.__con.commit() cur.close() def menu(self): print("1. Insert Record ") print("2. View All Records ") print("3. View Particular Record : ") print("4. Update Record : ") print("5. Delete Record : ") print("6. Exit the Program ") #Main program #call login page u1, p1 = login.login_page() #call function if (u1 != None and p1 != None): #create the object of Bank class B = Bank() while (True): B.menu() choice = int(input("Enter Yout Choice : ")) if (choice == 1): B.insertrecord() elif (choice == 2): B.selectallrecord() elif (choice == 3): B.select_particular_record() elif (choice == 4): B.update_record() elif (choice == 5):