From 4a0d7b815ddb82c8de78258f0d54b7326b765229 Mon Sep 17 00:00:00 2001 From: MikeTheWatchGuy Date: Fri, 24 Aug 2018 22:44:52 -0400 Subject: [PATCH] Correct exiting from application is user closes windows --- Demo_Chatterbot.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/Demo_Chatterbot.py b/Demo_Chatterbot.py index 15cfa808..6697335b 100644 --- a/Demo_Chatterbot.py +++ b/Demo_Chatterbot.py @@ -30,8 +30,11 @@ def print_progress_bar(description, iteration_counter, total_items, progress_bar global texts global training_form # update the form and the bars - training_form.ReadNonBlocking() - bars[current_bar].UpdateBar(iteration_counter, max=total_items) + button, values = training_form.ReadNonBlocking() + if button is None and values is None: + exit(69) + if bars[current_bar].UpdateBar(iteration_counter, max=total_items) is False: + exit(69) texts[current_bar].Update(description) if iteration_counter == total_items: current_bar += 1