如何获得更新的 tqdm.n
?
此代码似乎有效:
from tqdm import tqdm
pbar = tqdm(range(10000))
for i in pbar:
pbar.refresh()
print 'pbar', pbar.n
我必须调用 tqdm.refresh()
吗?
最佳答案
这似乎可行
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
关于python - 如何获取tqdm的当前值?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55458145/