From: Robin on
How can I make a command within a tkinter application repeat itself
over and over in intervals of a certain time.
Thanks,
-Robin
From: Peter Otten on
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()