entry二次取值求助
以下代码,不知道怎么二次取entry中的值,求助!def Hr_changeInf():
global item_text
global frame2
global canvas
global win
win=Toplevel()
win.geometry("1200x800+380+60")
win.resizable(width=False,height=False)
myframe = Frame(win, relief=GROOVE, width=1200, height=800, bd=1)
myframe.place(x=1, y=1)
canvas = Canvas(myframe, width=1170, height=760)
frame2 = Frame(canvas)
myscrollbar = Scrollbar(myframe, orient=VERTICAL)
myscrollbar.pack(side=RIGHT, fill=Y)
myscrollbar.config(command=canvas.yview)
canvas.config(yscrollcommand=myscrollbar.set)
canvas.pack(side=LEFT,fill=BOTH)
canvas.configure(scrollregion=canvas.bbox("all"))
canvas.create_window((0, 0), window=frame2, anchor='nw')
frame2.bind("<Configure>", myfunction)
data()
def myfunction(event):
canvas.configure(scrollregion=canvas.bbox("all"), width=1170, height=800)
def data():
global var2
global i
Pe_Number = emploeer_Info.get()
sql_field_name = comvalue.get()
sql = "select name from syscolumns where id=object_id('Hr_information')"
cursor.execute(sql)
data1 = tuple(cursor.fetchall())
b4 = Button(frame2, text="数据更新", width=20, command=mod_Hrinf) \
.grid(row=0, column=2, padx=10, pady=10, sticky=E)
for i in range(len(item_text)):
Inf1=StringVar()
Inf1.set(item_text.rstrip())#清除空格
Inf2=StringVar()
#Inf2.set(item_text.rstrip())
Inf3=StringVar()
Inf3.set(data1)
var1='L'+str(i)
var2='La'+str(i)
var3='Lb'+str(i)
var1=Entry(frame2,textvariable=Inf1,width=55)
var2=Entry(frame2,textvariable=Inf2,width=55)
var3=Label(frame2,textvariable=Inf3,width=13,anchor=E)
var1.grid(row=i + 1, column=1, padx=8, pady=5)
var2.grid(row=i + 1, column=2, padx=8, pady=5)
var3.grid(row=i + 1, column=0, padx=8, pady=5)
var2.insert(0, item_text)
def mod_Hrinf():#修改人员信息
pass
这里不知道怎么二次取Entry中修改过的值,初学者,请哪位大神指导一下 楼主,先解释一下,什么叫 "二次取值",你想干个什么事情? 你代码中,可以用var1.get() var2.get() 或者 Inf1.get()Inf2.get() entry第一次循环时已经赋值,修改entry的值后,var2重新取值加到一个数组中去,试了多种方法不能获取entry值,求解
页:
[1]