If a function is called from the root window and the function reaches no solution or the user wants to stop the function, can this be done from the root window and if so how? The following code produces two buttons - Start starts "while" using start() but start() cannot be halted by Quit. Using root.update_idletasks() in start() produces no effect.
#!/usr/bin/env python
from Tkinter import *
def start():
while True:
print "Stop me if you can from Quit"
root.update_idletasks()
root = Tk()
root.title('Example')
button1 = Button(root,text = 'Start', command = start)
button1.grid(row = 0, column = 0)
button2 = Button(root,text = 'Quit', command = root.destroy)
button2.grid(row = 1, column = 0)
root.mainloop()
REPLACE
root.update_idletasks()WITHroot.update()andstart()kills the root window from button2.