repeat tkinter
Peter Otten
__peter__ at web.de
Tue May 4 02:45:57 EDT 2010
Robin wrote:
> How can I make a command within a tkinter application repeat itself
> over and over in intervals of a certain time.
>>> import Tkinter as tk
>>> root = tk.Tk()
>>> color = "blue"
>>> def switch_color():
... global color
... if color == "blue":
... color = "red"
... else:
... color = "blue"
... root["background"] = color
... root.after(500, switch_color)
...
>>> switch_color()
More information about the Python-list
mailing list