Вот определение reset
определения функции внутри tqdm
пакета:
def reset(self, total=None):
"""
Resets to 0 iterations for repeated use.
Consider combining with `leave=True`.
Parameters
----------
total : int, optional. Total to use for the new bar.
"""
self.last_print_n = self.n = 0
self.last_print_t = self.start_t = self._time()
if total is not None:
self.total = total
self.refresh()
Вам не нужно обновлять значения self.last_print_t
, self.start_t
и просто обновлять total
Вместо того, чтобы звонить t.reset(total=new_total)
, вы должны сделать следующее:
t.total = new_total
t.refresh()
Пожалуйста, подтвердите, работает ли вышеуказанный режим так, как вам требуется.