我已经使用python的tkinter创建了一个GUI,我想以滚动文本显示mysql的数据,但是我总是会收到此错误。 这是代码:
def calendar():
top = Toplevel()
top.title("Calendar")
top.geometry("600x600")
st = ScrolledText.ScrolledText(top ,height=28)
mycursor.execute("SELECT* FROM calendar")
myresults = mycursor.fetchall()
Quote = myresults
for i in range(len(Quote)):
st.insert("end",Quote[i])
st.insert("end","\n")
st.pack()
label1=Label(top,text="service_id :")
label1.place(relx=0.4, rely=0.82)
entry1=Entry(top)
entry1.place(relx=0.6, rely=0.82)
button1 = Button(top, text="Select a service",command=lambda:update_service(entry1))
button1.place(relx=0.7 ,rely=0.9)
button2 =Button(top ,text="Add a service",command=add_service)
button2.place(relx=0.4 ,rely=0.9)
button3 =Button(top ,text="Delete a service",command=lambda:delete_service(entry1))
button3.place(relx=0.1 ,rely=0.9)