Skip to content

Add easy way to label progressbar from iterator wrapper helper function #168

@vaughnkoch

Description

@vaughnkoch

I couldn't find a way to add a simple label to the progressbar, especially in the convenience function which greatly reduces code and thus makes it super easy to add a progressbar.

This is what the current default output is:

from progressbar import progressbar
for x in progressbar(range(100)):
    .. some code ..
# Outputs:
# 100% (100 of 100) |###################| Elapsed Time: 0:00:10 Time:  0:00:10

Is it possible to add something like this to add a default label?

for x progressbar(range(100), label='Foobar')
...
# Outputs:
# Foobar: 100% (100 of 100) |###################| Elapsed Time: 0:00:10 Time:  0:00:10

If this is already possible, please disregard - I looked and couldn't find a way to do this easily, including DynamicMessage.

My version: progressbar2==3.37.1, Python 3.6.4.
P.S. I love this module, thanks for creating it.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions