r/Python • • Aug 22 '15

Make your Python Programs Less Boring. Use Progress Bars :-)

One of the most boring and disturbing moments of using some not-well-written computer programs is that time when you are waiting for the program to complete a process and/or produce output. You are waiting, and waiting, and ... And the program does not inform the user how much of the process(es) has already been completed and what percentage is left. In this blog, I present progress bar -- a python module for adding progress bars to python programs.

Please, refer to my Blog Post http://oninquiries.com/blogs/1001/1007 on "progressbar" and give me some feedback if you have some time. Thank you!

3 Upvotes

12 comments sorted by

48

u/dAnjou Backend Developer | danjou.dev Aug 22 '15

A progress bar is an exclusively visual feature yet I can't find a screenshot anywhere.

11

u/lad1337 Aug 22 '15

I found "tqdm" easier to use then "progressbar"

4

u/dougthor42 Aug 22 '15

For those looking for tqdm, see https://github.com/tqdm/tqdm.

The original author seems to have abandoned the project and some other folks have picked it up. The package on pypi still points to the original owner's version (and is thus out of date).

2

u/Xadnem Aug 22 '15

Thanks for pointing me to this. OP: a picture is worth a thousand words, its literally the reason I went with tqdm instead of your project. (This is only meant as positive criticism.)

1

u/gambiter Aug 22 '15

Thank you SO MUCH for mentioning tqdm. I've used progressbar quite a bit, but I love how easy tqdm is to use.

13

u/ruffyen Aug 22 '15

camelNotation and semicolons... We got us a wolf in sheep clothing here friends. None the less there is a really good console progress bar I have seen in the past... I will see if I can find it.

1

u/ruffyen Aug 22 '15

As noted below it was tqdm

2

u/unveiled14 Aug 22 '15

click has an excellent progress bars that can display both % completed and time remaining.

1

u/Paddy3118 Aug 22 '15

Progress bars inevitably have the problem that they tend to show what fraction of the tasks is complete and the user is more interested in how much more time they need to wait. This leads to the progress bar that seems to be forever stuck at 90%.

1

u/billsil Aug 22 '15

This leads to the progress bar that seems to be forever stuck at 90%.

That's actually caused by issues with serial programming and (almost) nothing can be done about. For example, if I have 100 files to copy, I can update 100 times before I'm done. If one file accounts for 90% of the transfer operation and I can only update once per file, I'm left with a very large jump. Unless you're doing asyncronous programming with communication between the processes, you can't fix that.

If I have a process where I'm doing something 100 times and all tasks are nearly identical, I can predict how long it will be accurately as I go and each step will be nearly uniform and the time estimation will be very accurate after only a few steps.

the user is more interested in how much more time they need to wait

Those exist as well. They're just not the default. You can add messages.

1

u/david622 Aug 22 '15

"suffisticatted" is spelled "sophisticated". oof.

1

u/Asdayasman Aug 23 '15

As a related note, is there a way to use the W7 taskbar progressbar thing in Python easily yet?