Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # Tk_3x4_btns.py
- import tkinter as tk
- root = tk.Tk()
- testList = ['A','B','C']
- nrows = 4
- ncols = 3
- for r in range(nrows):
- for c in range(ncols):
- btn = tk.Button(text=f'{testList[c]} : {c} : {r}' ,padx=50, pady=50)
- btn.grid(row = r, column=c)
- root.mainloop()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement