Skip to content

Instantly share code, notes, and snippets.

@garethng
Created May 7, 2020 02:56
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 garethng/cd8903336096b68a6469a04ec1f6f2ce to your computer and use it in GitHub Desktop.
Save garethng/cd8903336096b68a6469a04ec1f6f2ce to your computer and use it in GitHub Desktop.
python progress
def progress(percent,width=50):
if percent >= 100:
percent=100
show_str=('[%%-%ds]' %width) %(int(width * percent/100)*"#")
print('\r%s %d%%' %(show_str,percent),end='')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment