Created
May 7, 2020 02:56
-
-
Save garethng/cd8903336096b68a6469a04ec1f6f2ce to your computer and use it in GitHub Desktop.
python progress
This file contains 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
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