Tkinter provides a variety of built-in functions develop interactive and featured GUI (Graphical User Interface).
after() function is also a Universal function which can be used directly on the root as well as with other widgets.
after(parent, ms, function = None, *args)
parent: is the object of the widget or main window whichever is using this function.
ms: is the time in miliseconds.
function: which shall be called.
*args: other options.
When you run the program it will show a Tkinter window having a Button but after 5 seconds the window gets destroyed.
Code #2: Prompting a message after certain time (in our program after 5 seconds).
In below output a messagebox will prompt after 5 seconds you can even call any function after a certain period of time by passing the function name.
- Python | geometry method in Tkinter
- resizable() method in Tkinter | Python
- minsize() method in Tkinter | Python
- maxsize() method in Tkinter | Python
- destroy() method in Tkinter | Python
- iconphoto() method in Tkinter | Python
- Python | forget_pack() and forget_grid() method in Tkinter
- Python Tkinter | Moving objects using Canvas.move() method
- Python | place() method in Tkinter
- Python | pack() method in Tkinter
- Python | grid() method in Tkinter
- Python Tkinter | grid_location() and grid_size() method
- Place_forget() method using Tkinter in Python
- Python GUI - tkinter
- Python | askopenfile() function in Tkinter
- Python | Binding function in Tkinter
- Color game using Tkinter in Python
- Python | Message Encode-Decode using Tkinter
- Python - Tkinter askquestion Dialog
- Python | Simple registration form using Tkinter
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to email@example.com. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.