2008-08-19

Display the progress of long operations in Python

I'm developing a tool that will take a loooong time to complete, so I'd like to know what's the progress of its execution. Basically I'd like something to tell me "Processed: x of y" where x is the current position and y is the total to process.

On Python Cookbook there are three articles about it, but none of them satisfied me.

The I remembered that there's a program, written in Python, that does what I need: dput! So I wrote a simple script (if you want to look at it, use wget, not open with browser) to mimic what dput does.

At the end, I finally find a really nice module: progressbar. I'm preparing a package for Debian for it, since it contains many nice kind of progress bars. Anyhow, I needed to create a patch to add "Processed: 5 of 47"-kinda output, but it's really useful even as it is, even for you.

No comments: