from tkinter import *
root =Tk()
group1 = LabelFrame(root,text="充电模式请选择",font=("微软雅黑",15),padx=5,pady=5)
group1.pack()
K1 = [("自动充电",0),("定量充电",1),("定时充电",2),("定费充电",3)]
for k,n in K1:
b1 = Label(group1,text=k,font=("微软雅黑",15)).grid(row=n,column=0)
v1,v2,v3,v4 = StringVar(),StringVar(),StringVar(),StringVar()
e1 = Entry(group1,textvariable=v1).grid(row=0,column=1)
e2 = Entry(group1,textvariable=v2).grid(row=1,column=1)
e3 = Entry(group1,textvariable=v3).grid(row=2,column=1)
e4 = Entry(group1,textvariable=v4).grid(row=3,column=1)
def set_text():
v1.set('你真帅')
v2.set('我真的帅')
v3.set('啦啦啦~')
v4.set('库~')
Button(group1,text='改变内容',command=set_text).grid(row=4,column=0)
mainloop()