Skip to content

Instantly share code, notes, and snippets.

@cristianrubioa
Created November 16, 2020 04:41
Show Gist options
  • Save cristianrubioa/7a0a844b48560c72830b304f90c3d2d8 to your computer and use it in GitHub Desktop.
Save cristianrubioa/7a0a844b48560c72830b304f90c3d2d8 to your computer and use it in GitHub Desktop.
Waiting bar animation in Python
import sys
import time
animation = "|/-\\"
for i in range(100):
time.sleep(0.5)
sys.stdout.write("\r" + animation[i % len(animation)])
sys.stdout.flush()
print("End!")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment