Skip to content

Instantly share code, notes, and snippets.

@JaxkDev
Created May 28, 2019 12:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save JaxkDev/c77e28f541bee2b53cf466af555cb957 to your computer and use it in GitHub Desktop.
Save JaxkDev/c77e28f541bee2b53cf466af555cb957 to your computer and use it in GitHub Desktop.
A small snippet of a loading/progress bar that is one line on screen.
import sys, time
sys.stdout.write("["+" "*20+"] %s" % ("0"));
sys.stdout.write("\r");
for i in range(21):
time.sleep(0.1);
sys.stdout.write("["+("="*i)+(" "*(20-i))+"] %s" % (str(i*5)));
sys.stdout.write("\r");
sys.stdout.flush()
print("")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment