VOOZH about

URL: https://www.geeksforgeeks.org/python/python-after-method-in-tkinter/

⇱ Python | after method in Tkinter - GeeksforGeeks


  • Courses
  • Tutorials
  • Interview Prep

Python | after method in Tkinter

Last Updated : 11 Jul, 2025

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)


 

Parameters: 
parent: is the object of the widget or main window whichever is using this function. 
ms: is the time in milliseconds. 
function: which shall be called. 
*args: other options.


Code #1:
 

Output: 
 


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).
 

Output: 
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.
 


 

Comment
Article Tags: