Python tqdm.set_postfix_str()














































Python tqdm.set_postfix_str()



tqdm.set_postfix_str(self, s='', refresh=True)
Postfix without dictionary expansion, similar to prefix handling.

Code:
from tqdm import tqdm
from time import sleep

pbar = tqdm(total=
200, ascii=True)
for i in range(10):
        pbar.set_postfix_str(
'Hello')
        pbar.update(
20)
        sleep(
0.5)

#pbar.clear()
pbar.close()


Output:

100%|#########################################################################| 200/200 [00:04<00:00, 40.72it/s, Hello]

Comments