Skip to content

Instantly share code, notes, and snippets.

@sooryan
Created July 25, 2015 07:09
Show Gist options
  • Save sooryan/6f6e4b8fb0865370e16d to your computer and use it in GitHub Desktop.
Save sooryan/6f6e4b8fb0865370e16d to your computer and use it in GitHub Desktop.
A simple loading animation in the command line with python
import time,sys
while True:
blah="\|/-\|/-"
for l in blah:
sys.stdout.write(l)
sys.stdout.flush()
sys.stdout.write('\b')
time.sleep(0.2)
@tejas-adg
Copy link

For some reason, it prints '1' after each slash and on the next line, basically : '1\n1'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment