Lesson-8: Tkinter Grid Geometry Manager

Tkinter Grid Geometry Manager

This geometry manager is suitable for interfaces where window tools will be sorted in a “grid” format. Let’s continue our lesson through the following example.

import tkinter as tk
import random

ad = tk.Label(text="ADINIZ: ")
soyad = tk.Label(text="SOYADINIZ: ")
numara = tk.Label(text="NUMARANIZ: ")

ad_giris = tk.Entry()
soyad_giris = tk.Entry()
numara_giris = tk.Entry()


In the example above, there are 3 label tools and 3 entry widgets. In previous examples, we put these tools in the window with the pack() command. In this example, we will use the grid command. The Grid command takes 2 parameters in parentheses. These are” row” and “column” values.


The word means “line” in English. With this option, we will determine which row the window tool will be located in.


With this option, we will determine which column our window tool will be located on the window.

ad = tk.Label(text="ADINIZ: ")

ad_giris = tk.Entry()

In the short code example, the label row and column values named name are 0. Entry is 1 if row 0 is column. In two tools, it is located in the zero row, and the label is in the zero column Entry 1.it is located in the column. So they are located side by side.

Screen Shot:

Tkinter Grid
Grid Geometri Yöneticisi

As you can see, with the help of this grid() method, we can make more fine adjustments compared to the pack() method. the “grid ()” method allows us to specify the coordinates of our window tool more precisely.

You may also like...

Leave a Reply

Your email address will not be published. Required fields are marked *