i am trying to make a simple RGB animation with python, and I am having some difficulties.
The problem really is the output, that is completely wrong as what I wanted.
Code:
def animation(message):
def yuh():
while True:
colors = dict(Fore.__dict__.items())
for color, i in zip(colors.keys(), range(20)):
sys.stdout.write(colors[color] + message + "\r")
sys.stdout.flush()
sys.stdout.write('\b')
time.sleep(0.5)
threading.Thread(target=yuh).start()
def menu():
animation("Hello Please select a option !")
print("1 -- Test")
qa = input("Answer?: ")
if qa == 1:
print("You did it !")
sys.exit()
menu()
Output:
1 -- Test
Hello Please select a option !a option !
My initial thoughts werw that the output looked like this:
Hello Please select a option !
1 -- Test
Answer?:
How am I able to do this?