Ejemplo n.º 1
0
def App(locations):
    os.system('cls||clear')
    print("Welcome to the TSP calculator\n")
    temp = ""
    while temp != "Q":
        os.system('cls||clear')
        choice = False
        print("Input a number and press Enter to perform an action\n")
        print("1 - Calculate shortest path")
        print("2 - Update locations list")
        print("3 - View locations list")
        print("Q - Quit")

        temp = input()
        os.system('cls||clear')
        if temp == "1":
            Run(locations)
            choice = True

        if temp == "2":
            locations = UpdateLocations(locations)
            choice = True

        if temp == "3":
            ListFunctions.ViewList(locations)
            V.ShowPositions(locations)
            choice = True

        if temp == "Q" or temp == "q":
            print("Goodbye!")
            return

        if choice == False:
            print("Command not recognised, enter a number between 1 and 3\n")