Can I add message to the tqdm progressbar?

The example shown in Usage of tqdm works well for me.

pbar = tqdm(["a", "b", "c", "d"])
for char in pbar:
    pbar.set_description("Processing %s" % char)

Or alternatively, starting Python 3.8 which supports the walrus operator :=:

for char in (pbar := tqdm(["a", "b", "c", "d"])):
    pbar.set_description(f"Processing {char}")

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)