Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Progress bar #214

Merged
merged 6 commits into from
Sep 15, 2015
Merged

Progress bar #214

merged 6 commits into from
Sep 15, 2015

Conversation

henryiii
Copy link
Collaborator

I've added a progress bar to plumbum.cli.terminal, with auto sizing and iterator support. To use, simply wrap a slow iterator with Progress:

>>> for value in Progress(BigSlowCalcululationIterator):
    pass

Or use a fast iterator with .wrap or use .range:

>>> for value in Progress.range(10):
    # Slow calculations here
    time.sleep(1)

The output looks like this:

[******* 85% *****    ] 0:00:17 completed, 0:00:03 remaining

IPython notebooks are supported, too, through ProgressAuto (which selects text or HTML output based on what is available).

I updated cli.terminal docs.

@henryiii henryiii modified the milestone: v1.5.1 Aug 27, 2015
tomerfiliba added a commit that referenced this pull request Sep 15, 2015
@tomerfiliba tomerfiliba merged commit 3654bf6 into master Sep 15, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants