Advertisement
here2share

# Tk_close_after_2s_threading.py

Dec 26th, 2021
1,387
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.26 KB | None | 0 0
  1. # Tk_close_after_2s_threading.py
  2.  
  3. import threading
  4. import tkinter
  5.  
  6. root = tkinter.Tk()
  7. tkinter.Frame(root, width=250, height=100).pack()
  8. tkinter.Label(root, text='Hello Threading').place(x=20, y=10)
  9.  
  10. threading.Timer(3.0, root.destroy).start()
  11.  
  12. root.mainloop()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement