3 ms·
Have you ever used a for loop? You don't know how long it'll take, but you know how many iterations, and at any given point you can know how long past iteration
by nostoc 5y ago
Have you ever used a for loop? You don't know how long it'll take, but you know how many iterations, and at any given point you can know how long past iterations have taken. Extrapolation is not hard, even if not always accurate.
- cowsandmilk 5y agoThere are plenty of for loops in which you don’t know how many iterations you will have. With a generator, it can even be infinite.
- berkes 5y agoIn which case the visualisation will adjust and show this fact. E.g. passing an unbounded range will jus show some info about the past iterations.
- formerly_proven 5y agoThis is not how for loops work in Python, which does not have ranged loops. The example works because range objects implement __len__ which is where tqdm will get it's total/count information from.