How to delete Tkinter widgets from a window?

Sometimes, we want to remove a widget that is of no use in the application. We can delete widgets from the window or frame using the .destroy method in tkinter. It can be invoked in the widget by defining a function for it.


In this example, we have created a button that will remove the text label widget from the window.

#Import the tkinter library
from tkinter import *

#Create an instance of tkinter frame
win = Tk()

#Set the geometry

#Define a function to remove the text from the screen
def delete_text():

#Create a text widget
text= Label(win,text="This is a New Line", font=('Aerial bold', 20))

#Create a button for Deleting Widget
Button(win, text= "Click Here", font=('bold',20), command=



Running the above code will produce the following output −

Now, click the "Click Here" button. It will delete the Label Text widget from the window.