import tkinter as tk
from tkinter import ttk
win = tk.Tk()
win.title("LabelFrame练习")
buttons_frame = ttk.LabelFrame(win, text=' Labels in a Frame ')
buttons_frame.grid(column=0,row=0,padx=200,pady=100)
ttk.Label(buttons_frame, text="标签1").grid(column=0, row=0, sticky=tk.W)
ttk.Label(buttons_frame, text="标签2").grid(column=0, row=1, sticky=tk.W)
ttk.Label(buttons_frame, text="标签3").grid(column=0, row=2, sticky=tk.W)
ttk.Button(buttons_frame, text="按钮1").grid(column=1, row=0, sticky=tk.W)
ttk.Button(buttons_frame, text="按钮2").grid(column=1, row=1, sticky=tk.W)
ttk.Button(buttons_frame, text="按钮3").grid(column=1, row=2, sticky=tk.W)
for child in buttons_frame.winfo_children():
child.grid_configure(padx=20, pady=10)
win.mainloop()