Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # Tk_close_after_2s.py
- from tkinter import Label, Tk
- root = Tk()
- prompt = 'hello'
- label1 = Label(root, text=prompt, width=len(prompt))
- label1.pack()
- def close_after_2s():
- root.destroy()
- root.after(2000, close_after_2s)
- root.mainloop()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement