def updatehw():
markIntHw = tkinter.DoubleVar()
dateSrtHw = tkinter.StringVar()
mark = ttk.Entry(englishGraphsRoot, textvariable=markIntHw, text="Mark")
dat = ttk.Entry(englishGraphsRoot, textvariable=dateSrtHw, text="Date")
def getr():
xv = markIntHw.get()
xt = dateSrtHw.get()
cursor.execute('INSERT INTO graph_englishhw(xticks, xvalues) VALUES(?, ?)', (xt, xv))
connection.commit()
mark.destroy()
dat.destroy()
buttonUpdateHw.destroy()
buttonUpdateHw = ttk.Button(command=getr, text="Submit")
buttonUpdateHw.pack()
除了xt和xv不会获取输入的值,而是将0.0和None添加到表中。