"brindly sujith" <[EMAIL PROTECTED]> wrote

>i want to run a timer in a window
> 
> plz guide me how to do this

There is a timer facility in Tkinter for this.

In your window constructor add a call to self.after()
Add a callback function/lambda that closes the window.

> send me the Tkinter code for this
##############
from Tkinter import *

tk = Tk()
L =Label(tk, text="Wait for it!")
L.pack()
L.after(5000, tk.quit  )  # quit after 5000ms

tk.mainloop()
###############
Is the shortest I could think of...

HTH,

-- 
Alan Gauld
Author of the Learn to Program web site
http://www.freenetpages.co.uk/hp/alan.gauld

_______________________________________________
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor

Reply via email to