tqdm is a Python module to easily print in the console a dynamically updating progressbar. For example
from tqdm import tqdm
from time import sleep
for _ in tqdm(range(10)):
sleep(0.1)
prints a dynamic progressbar in the console for 1sec as the iteration executes: 
I have not figured out how to use tqdm with the builtin zip object.
The use case of this would be to iterate over two corresponding lists with a console progressbar.
For example, I would expect this to work:
for _, _ in tqdm(zip(range(10), range(10))):
sleep(0.1)
but the progressbar printed to the console in this case is not correct: 
A workaround is to use tqdm with enumerate, however then an iterator index must be defined and managed.


所有评论(0)