Skip to content

tqdm.write() broken with manually positioned bars #532

@waspinator

Description

@waspinator

I have two progress bars and I'd like to write underneath them. Is there a way to set the position of the write function so that the two progress bars don't move?

This is what I'd like to acheive:

bar one:  40%|████████▍           | 4/10 [00:06<00:09,  1.54s/it]
bar two: 100%|████████████████████| 20/20 [00:01<00:00,  9.78it/s]
test
test
test
...
from tqdm import tqdm
from time import sleep

bar_one = tqdm(total = 10, position=0, desc="bar one")
for i in range(10):
    bar_one.update(1)
    tqdm.write('test')
    bar_two = tqdm(total = 20, position=1, desc="bar two")
    for j in range(20):
        bar_two.update(1)
        sleep(0.1)

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions