Nov-23-2021, 04:26 PM
(This post was last modified: Nov-23-2021, 04:26 PM by deanhystad.)
You cannot use pack() and grid() in the same frame, so make a frame for the radio buttons.
import tkinter as tk root = tk.Tk() var_1 = tk.IntVar(0) tk.Label(root, text="""Radio Buttons""", justify=tk.LEFT, padx=20).pack() radio_frame = tk.Frame(root) radio_frame.pack() for index, button in enumerate('ABCD'): button = tk.Radiobutton(radio_frame, text=button, variable=var_1, value=index) # Buttons are added to radio_frame, not root button.grid(row=index // 2, column=index % 2, padx=5, pady=5) root.mainloop()