[SciPy-dev] adding a nice progressbar to scipy

Ondrej Certik ondrej@certik...
Thu Jan 10 09:11:57 CST 2008


Hi,

in almost all of my computational projects, I use this nice progressbar:

http://pypi.python.org/pypi/progressbar/

it's very easy to use:

    widgets=["calculating", " ", progressbar.Percentage(), ' ',
            progressbar.Bar(), ' ', progressbar.ETA()]
    pbar=progressbar.ProgressBar(widgets=widgets,maxval=10000).start()
    for i in range(10000):
        pbar.update(i)
        #do some heavy calculation in each step
    pbar.finish()


and it shows the progress, estimated time of arrival (ETA), it's
completely configurable with
many options, etc. I just asked the author
and he made the code dual licensed under BSD and LGPL (the original license).

Especially the ETA is very handy, because I get a clue how long I need
to wait for my code
to finish and I get it for free (see the above example).

Would this be a good adition to scipy? This is an example of a small
but handy code, that
I am lazy to install, but if it was in scipy, I'd be much more easier to use it.

I'd send a patch then and write a helper function, so that it can be
used like this
for users that just want the default behavior:

    pbar=progressbar(maxval=10000)
    for i in range(10000):
        pbar.update(i)
        #do some heavy calculation in each step
    pbar.finish()

Ondrej


More information about the Scipy-dev mailing list