From: Robin on 4 May 2010 01:00 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 4 May 2010 02:45 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()
|
Pages: 1 Prev: msg_footer Next: Recursive functions not returning lists as expected |