How can I resize the root window in Tkinter?

PythonTkinterServer Side ProgrammingProgramming

In this example, we will see how to resize a tkinter window using the geometry manager. Tkinter geometry manager is generally used to configure the width and height of a tkinter window.

The geometry(width, height)method takes width and height as instances and resizes the window accordingly. We can also define the position of the tkinter window by adding geometry(width x height, X, Y) where x and y are horizontal and vertical positions of the window.


#Import tkinter library
from tkinter import *
from tkinter import ttk
#Create an instance of tkinter frame or window
win= Tk()
#Set the geometry of tkinter frame
#Create a Label widget
label1= Label(win, text="Hello There!", font= ('Courier 20 underline'))


Now, run the above code to display the dynamically resized tkinter window.

Published on 21-Apr-2021 07:41:18