Created
December 3, 2022 20:28
-
-
Save langford/55862a24001e3d5629eea7c6dd3574dc to your computer and use it in GitHub Desktop.
Emotional Feeling of a Progress Bar
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 | |
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