Skip to content

Instantly share code, notes, and snippets.

@edgesider
Created May 20, 2019 13:07
Show Gist options
  • Save edgesider/8dcf3001c452396838c81e5293c32269 to your computer and use it in GitHub Desktop.
Save edgesider/8dcf3001c452396838c81e5293c32269 to your computer and use it in GitHub Desktop.
python cli progress
import time
def print_progress(completed, length=20, cell='█', empty='░', begin='', end=''):
completed = int(completed)
completed = length if completed > length else completed
print(begin + cell * completed + empty * (length-completed) + end, end='')
for i in range(51):
print('\r', end='')
print_progress(i, 50, cell='=', empty=' ', begin='[', end=']')
time.sleep(0.1)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment