January 13, 2010

Python - Command Line Progress Bar With Percentage and Elapsed Time Display

Here is a Python module which produces an ascii command line progress bar with percentage and elapsed time display.

code:
progress_bar.py

to use:

from progress_bar import ProgressBar

p = ProgressBar(60)
    
p.update_time(15)
print p
    
p.fill_char = '='
p.update_time(40)
print p

results:

[##########       25%                  ]  15s/60s
[=================67%=====             ]  40s/60s
Post a Comment