tqdm progressbar and zip built-in do not work together

tqdm can be used with zip if a total keyword argument is provided in the tqdm call.

The following example demonstrates iteration over corresponding elements in two lists with a working __tqdm__ progress bar for the case where a total keyword argument is used:
enter image description here

The issue is that tqdm needs to know the length of the iterable ahead of time. Because zip is meant to handle iterables with different lengths, it does not have as an attribute a single length of its arguments.

So, __tqdm__ still works nicely with zip, you just need to provide a little manual control with the total keyword argument.

Leave a Comment

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