def menu(): print("Welcome To Kyrat") print("Please choose an option below to get started:") print("\1. Show Users") print("\2. Show Products") print("\3. Compare Tables") print("\4. Update Customer Entry ") print("\5. Update Product Entry") print("\6. Delete Entry") choice = int(input()) if choice == 1: query() elif choice == 2: product_query() elif choice == 3: inner_join() elif choice == 4: update() elif choice == 5: product_update() elif choice == 6: delete_mexico() else: print("Invalid Input!")
def unpublish(id): """ This function updates an existing story :param id: id of person to update in the story status :return: updated story """ story = get(id) if story: update(id, False) return read_one(id) else: abort(404, "Record not found")
def customer_info(): print("Do you want to compare tables?") choice = input() if choice == 'y': inner_join() print("Do you want to see all the users?") choice = input() if choice == 'y': query() print("Do you want to update entry?") choice = input() if choice == 'y': print("Specify entry") entry = input() update(entry) elif choice == 'q': quit() first_name = input("First Name: ") last_name = input("Last Name: ") customer_entry(first_name, last_name)
def main(): #check if valid input if len(sys.argv)==2: #get database name and connect to it db.connect(sys.argv[1]) if db.CON is not None: #print init message print(f"""Successfully connected to {db.NAME}\nType 'help' for more information.\n Make sure to call 'init' if this is a new database""") while True: #ead and parse user input user_in = input('>') print('\n') cmd = user_in.split(maxsplit=1) function = cmd[0].strip() if function == 'quit': break elif function == 'help': dbhelp() elif function == 'dbinfo': db.info() elif function == 'init': db.make_db() elif function == 'update' :db.update() else: print_result(function, parse(user_in)) else: print('Could not connect.') else: print("Error: Please enter a database name.")