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
10 comments:
Handy, thanks a bunch!
so how to use this is actual code ?
Can you show that in - say - downloading a file ?
Note, you can also update the total time using `p.duration = new_time`. It won't take effect until you call `update_time()` though.
I'm always surprised how many people don't notice the progressbar module that's been in pypi.
The couple in pypi that depend on fcntl are unix only.
Thanks, this is great! Just what I was looking for. Or rather thinking about doing myself as an exercise.
Nice, simple and compact - Good job!
However there is a module, as pointed out in a previous post in pypi - you could think about submitting this as a stripped down version?
The couple in pypi that depend on fcntl are unix only.
http://pypi.python.org/pypi/progressbar works in windows too!
Post a Comment