Skip to content

Instantly share code, notes, and snippets.

@sehrishnaz
Created April 7, 2021 07:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sehrishnaz/316a0f8df898dc0d7bb8e4f34e4cac5d to your computer and use it in GitHub Desktop.
Save sehrishnaz/316a0f8df898dc0d7bb8e4f34e4cac5d to your computer and use it in GitHub Desktop.
Layout Managers in Tkinter - .grid() geometry manager
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