Python tqdm.set_description_str()














































Python tqdm.set_description_str()



tqdm.set_description_str(self, desc=None, refresh=True)
Set/modify description without ': ' appended.

from tqdm import tqdm from time import sleep pbar = tqdm(total=200, ascii=True) for i in range(10): pbar.set_description_str(desc="Reached {}".format(i)) pbar.update(20) sleep(0.5) pbar.close()

Reached 6:  70%|###################################6               | 140/200 [00:03<00:01, 43.60it/s]
Reached 9: 100%|###################################################| 200/200 [00:08<00:00, 32.22it/s]

Comments