def user_input(): try: user_input = int(input("\033[34m" + "Please choose: " + "\033[39m")) if user_input == 1: commands.list_item(commands.load()) elif user_input == 2: commands.add_item(commands.load()) elif user_input == 3: commands.list_item(commands.load()) commands.change_status_item(commands.load()) elif user_input == 4: commands.list_item(commands.load()) commands.remove_item(commands.load()) elif user_input == 5: commands.remove_completed_items(commands.load()) elif user_input == 6: exit() else: print("Please choose a number from the menu!") except ValueError: print("Please enter a number!")
def menu(): print("\033c") print("*********************************************************") print(" * * * * * * * * ") print("* * * 1 List items * * *") print(" * * 2 Add a new item * * ") print("* 3 Remove an item *") print(" * * 4 Complete an item * * ") print("* * * 5 Exit program * * *") print(" * * * * * * * * ") print("*********************************************************") choosen = input("Choose an option: ") if choosen == "1": print() print("\033c") commands.list_todo() input("For main menu hit enter ") menu() elif choosen == "2": commands.add_new() commands.list_todo() input("For main menu hit enter ") menu() elif choosen == "3": commands.remove_item() print() commands.list_todo() input("For main menu hit enter ") menu() elif choosen == "4": commands.list_todo() commands.make_complete() commands.list_todo() # ???! commands.list_todo() input("For main menu hit enter ") menu() elif choosen.upper() == "Q": pass
def menu(): print("\033c") print("*************************************") print("* * * 1 List items * * *") print("* * 2 Add nem item * *") print("* 3 Remove item *") print("* * 4 Complete Item * *") print("* * * Q Exit Program * * *") print("*************************************") choosen = input("Choose an option: ") if choosen == "1": print() print("\033c") commands.list_items(csv_input) input("For main menu hit enter ") menu() elif choosen == "2": commands.add_new() commands.list_items(csv_input) input("For main menu hit enter ") menu() elif choosen == "3": commands.remove_item() print() commands.list_items(csv_input) input("For main menu hit enter ") menu() elif choosen == "4": commands.list_items(csv_input) commands.make_complete() commands.list_items(csv_input) # ???! commands.list_items(csv_complete) input("For main menu hit enter ") menu() elif choosen.upper() == "Q": pass