Skip to content

Instantly share code, notes, and snippets.

@langford
Created December 3, 2022 20:28
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 langford/55862a24001e3d5629eea7c6dd3574dc to your computer and use it in GitHub Desktop.
Save langford/55862a24001e3d5629eea7c6dd3574dc to your computer and use it in GitHub Desktop.
Emotional Feeling of a Progress Bar
import time
import sys
import os
def clearline():
sys.stdout.write("\033[2K\033[1G")
def clearscreen():
return
# for windows OS
if os.name =="nt":
os.system("cls")
# for linux / Mac OS
else:
os.system("clear")
l=0
barLeng = 62
for c in range(barLeng):
clearline()
sys.stdout.write("Download Progress ")
for dist in range(c):
sys.stdout.write(".")
sys.stdout.flush()
time.sleep(0.075)
for c in range(barLeng):
clearline()
sys.stdout.write("Download Progress ")
for dist in range(barLeng-c):
sys.stdout.write(".")
sys.stdout.flush()
time.sleep(0.075)
print("\n(Not) Done")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment