A progress bar tool, there are two versions(grey version and color version).


  • Python 2.7 or 3

How to use?

Import the ProgressBar class to your code from or

from progress_bar_color import ProgressBar

Creat a ProgressBar class and pass your total steps(i.e. 1000) to initialize it

pb = ProgressBar(1000)

Every time you finish one step, call show_progress funtion to update the progress bar


When you finish your job, don't remember to call end function to start a new line


You can see for reference.

You want to change the color?

If you want to change the color to show, just modify a number in

You can find this:

'\033[0;34m %d \033[0m'

The '0' before ';' is to define whether show high light color or not. '1' is to show high light color, '0' is not.

The '34' before ';' is the character color, you can change it to the following value:

color value
black 30
red 31
green 32
yellow 33
blue 34
deep pink 35
cyan 36
white 37


You may get this error when you use python3:

UnicodeEncodeError: 'ascii' codec can't encode characters in position 27-66: ordinal not in range(128)


Add following argument to file ~/.bashrc

export LANG='C.UTF-8'

Then execute:

source ~/.bashrc