Tk mainloop()

Heike C. Zimmerer usenet03q2 at hczim.de
Sun Jul 20 14:39:56 CEST 2003


"Petr Evstratov" <tetra701 at mail.ru> writes:

> Hi, I have a question: how do you execute an arbitrary function in Tk fooBar.mainloop()?
>
> I need to change the contents of a label every second, but I think I will also use some other functions as well...

Use the after() method, like in:

  def periodic()
      ... do something useful ...
      widget.after(1000, periodic)

  ...
  periodic()
  ...

  widget.mainloop()


Greetings,

 Heike




More information about the Python-list mailing list