Auto-flushing when wrapping streams? · Issue #160 · wolph/python-progressbar · GitHub
Skip to content

Auto-flushing when wrapping streams? #160

Description

@davidparsson

Description

Have you considered some kind of auto-flushing when wrapping the streams? In the cases where each progress step takes a while, it would be convenient to get log outputs more frequently without manually calling progressbar.streams.flush(). Please run the code below for a frustrating example of too long waiting times.

Code

import time
import progressbar


with progressbar.ProgressBar(redirect_stdout=True) as progress:
    for i in progress(range(3)):
        for j in range(10):
            time.sleep(0.5)
            print(i, j)
            # progressbar.streams.flush()

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