Grouping inputs with the LabelFrame widget
The LabelFrame
class can be used to group multiple input widgets, indicating the logical entity with a label they represent. It is typically used in forms and is very similar to the Frame
widget.
Getting ready
We will build a form with a couple of LabelFrame
instances, each one with their corresponding child input widgets:

How to do it…
Since the purpose of this example is to show the final layout, we will add some widgets, without keeping their references as attributes:
import tkinter as tk
class App(tk.Tk):
def __init__(self):
super().__init__()
group_1 = tk.LabelFrame(self, padx=15, pady=10,
text="Personal Information")
group_1.pack(padx=10, pady=5)
tk.Label(group_1, text="First name").grid(row=0)
tk.Label(group_1, text="Last name").grid(row=1)
tk.Entry(group_1).grid(row=0, column=1, sticky=tk.W)
tk.Entry(group_1).grid(row=1, column=1, sticky=tk.W)
group_2...