summaryrefslogtreecommitdiffstats
path: root/Demo/tkinter
diff options
context:
space:
mode:
Diffstat (limited to 'Demo/tkinter')
-rwxr-xr-xDemo/tkinter/guido/electrons.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/Demo/tkinter/guido/electrons.py b/Demo/tkinter/guido/electrons.py
index f3b8008..d764380 100755
--- a/Demo/tkinter/guido/electrons.py
+++ b/Demo/tkinter/guido/electrons.py
@@ -52,8 +52,11 @@ class Electrons:
# Run -- never returns
def run(self):
- while 1:
- self.random_move(self.n)
+ try:
+ while 1:
+ self.random_move(self.n)
+ finally:
+ self.tk.destroy()
# Main program