How to run an infinite loop on Menu?
I need to run an infinite loop on a Menu button, like this:
from Tkinter import *
i = 0
i = i + 1
if i > 100:
root = Tk()
menu = Menu(root)
filemenu = Menu(menu)
In fact, the def run_job has more things to do. But, it is an infinite loop in essence. It works. However, when the def run_job is running, the menu will be hang there. I have no way to stop it. Even if I raise it with Key-Interupt, the thing was the same: the infinite loop cannot be stopped nicely. The only way was to wait until the Python interpreter notice the problem, and popped out an error message, then I can kill the running program.
Can anybody tell me how to handle this? I wish when variable i reached 100, the run_job will be end, and the Menu "Run" will be free.
Thanks in advance.