Reputation: 389
How do I get an updated tqdm.n
?
This code seems to work:
from tqdm import tqdm
pbar = tqdm(range(10000))
for i in pbar:
pbar.refresh()
print 'pbar', pbar.n
Do I have to call tqdm.refresh()
?
Upvotes: 2
Views: 9587
Reputation: 1414
This seems to work
from tqdm import tqdm
class TqdmSpy(tqdm):
@property
def n(self):
return self.__n
@n.setter
def n(self, value):
print(value, self.total)
self.__n = value
Upvotes: -1