GH avatar Bite 171. Make a terminal spinner animation

In this Bite you will spice up your command line apps with a loader animation.

You will use itertools.cycle and sys.stdout to make the following terminal spinner animation:

our fancy spinner animation in action

Apart from the module imports we already defined SPINNER_STATES and STATE_TRANSITION_TIME = the amount of time to pause between states. Hopefully this will make it a bit easier.

One last hint is to look at how to flush terminal output so states you print to stdout don't get concatenated.

Good luck and keep calm and code in Python!

21 out of 22 users completed this Bite.
Will you be Pythonista #22 to crack this Bite?
It takes an average of ~63 minutes to solve this Bite (submissions 5-240 min).
Pythonistas rate this Bite 7.0 on a 1-10 difficulty scale.
» Up for a challenge? 💪

Buy Now Login and get coding
We use Python 3.7