Exemplo n.º 1
0
        elif root and cmd.split(" ")[0] == "exit":
            task = input("Do you really want to leave root? (YES/No) ")
            if task != "No" or task != "N" or task != "n" or task != "no":
                root = False
        elif not root and cmd.split(
                " ")[0] == "exit" or not root and cmd.split(" ")[0] == "quit":
            quit_task = input(
                wrap.bold(
                    "This action will cause the program to self destruct. " +
                    "(YES/No) "))
            if quit_task != "No":
                time_count = 3000
                print(wrap.clear())
                with wrap.location(0, 0):
                    print(wrap.bold("Make a wish!"))
                for i in range(time_count, 0, -1):
                    with wrap.location(0, wrap.height - 2):
                        min = int(str(i / 1000).split(".")[0])
                        mills = int(str(i / 1000).split(".")[1])
                        print(
                            wrap.bold_red(
                                'Remained %d.%d seconds before destruction. ' %
                                (min, mills)))
                    time.sleep(0.01)
                with wrap.location(0, wrap.height - 2):
                    print(wrap.clear_eos())
                with wrap.location(0, wrap.height - 2):
                    print(wrap.bold_red_blink("Time's up!"))
                    time.sleep(1)
                run = False