Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

print statements between progress bars begin at the end of the progress bar line #162

Copy link
Copy link

Description

@jasonslay
Issue body actions

Description

When using redirect_stdout=True, printing between progress bars begins printing at the end of the line the progress bar was on. In the example below the 'halftime' appears on the end of the line from the first progress bar (and is forced to wrap after the first character). I would expect it to start on a new line. Is this not the case?

Code

import time
import progressbar

for ix in progressbar.progressbar(range(5), redirect_stdout=True):
    print('first', ix)
    time.sleep(0.02)

print('halftime')

for ix in progressbar.progressbar(range(5), redirect_stdout=True):
    print('second', ix)
    time.sleep(0.02)

Output

first 0
first 1
first 2
first 3
first 4
100% (5 of 5) |#################| Elapsed Time: 0:00:00 Time:  0:00:00halftime
second 0
second 1
second 2
second 3
second 4
100% (5 of 5) |#################| Elapsed Time: 0:00:00 Time:  0:00:00

Versions

  • Python version: 3.6.5 (default, Mar 30 2018, 06:41:53)
  • Python distribution/environment: CPython
  • Operating System: MacOS 10.13.4
  • Package version: 3.37.0
Reactions are currently unavailable

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

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.