Created
July 25, 2015 07:09
-
-
Save sooryan/6f6e4b8fb0865370e16d to your computer and use it in GitHub Desktop.
A simple loading animation in the command line with python
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
For some reason, it prints '1' after each slash and on the next line, basically : '1\n1'