How to use Tkinter in python to edit the title bar?

Tkinter creates a window or frame that appears after executing the program. Since all the functions and modules in Tkinter are independent, we can specifically use a particular function to customize the window attributes.

Tkinter creates a default root window for every application. To customize or edit the default title of Tkinter window, we can use the following method,

title(text= “your title”)

Let us create a window by initiating an object of Tkinter frame and edit the title of the window or frame.


#Import the library
from tkinter import *

#Create an instance of window
win= Tk()

#Set the geometry of the window

#Set the title of the window

#Create a label if needed
Label(win, text= "The Title is", font=('Helvetica bold',20), fg= "green").pack(pady=20)

#Keep running the window or frame


The above Python code will set the title as