I have this code:
animation = ["[■□□□□□□□□□]", "[■■□□□□□□□□]", "[■■■□□□□□□□]", "[■■■■□□□□□□]",
"[■■■■■□□□□□]", "[■■■■■■□□□□]", "[■■■■■■■□□□]", "[■■■■■■■■□□]",
"[■■■■■■■■■□]", "[■■■■■■■■■■]"]
import sys
for i in range(len(animation)):
time.sleep(0.2)
sys.stdout.write("\r" + animation[i % len(animation)]+ "\n")
sys.stdout.flush()
But the animation is one by one like this:
[■□□□□□□□□□]
[■■□□□□□□□□]
Instead of replacing the boxes. How can I make it look like an animation?
Edit: i forget to mention that i use it inside a pysimpleguy layout. Dont know if it its important.