From 99649c162602ad3582987b258a6a75c87be3395d Mon Sep 17 00:00:00 2001 From: itaicaspi-intel Date: Thu, 13 Sep 2018 15:03:24 +0300 Subject: [PATCH] progress bar update --- rl_coach/utils.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/rl_coach/utils.py b/rl_coach/utils.py index 88f74c5..db58baa 100644 --- a/rl_coach/utils.py +++ b/rl_coach/utils.py @@ -558,14 +558,15 @@ class ProgressBar(object): self.max_value = max_value self.current_value = 0 - def update(self, current_value): + def update(self, current_value, additional_info=""): self.current_value = current_value percentage = int((100 * current_value) / self.max_value) - sys.stdout.write("\rProgress: ({}/{}) Time: {} sec {}%|{}{}| " + sys.stdout.write("\rProgress: ({}/{}) Time: {} sec {}%|{}{}| {}" .format(current_value, self.max_value, round(time.time() - self.start_time, 2), percentage, '#' * int(percentage / 10), - ' ' * (10 - int(percentage / 10)))) + ' ' * (10 - int(percentage / 10)), + additional_info)) sys.stdout.flush() def close(self):