Created
April 7, 2021 07:18
-
-
Save sehrishnaz/316a0f8df898dc0d7bb8e4f34e4cac5d to your computer and use it in GitHub Desktop.
Layout Managers in Tkinter - .grid() geometry manager
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import tkinter as tk | |
window = tk.Tk() | |
for i in range(5): | |
for j in range(5): | |
frame = tk.Frame( | |
master=window, | |
relief=tk.RAISED, | |
borderwidth=1 | |
) | |
frame.grid(row=i, column=j) | |
label = tk.Label(master=frame, text=f"Row {i}\nColumn {j}") | |
label.pack() | |
window.mainloop() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment