0
Baically我創建了一個簡單的數學遊戲增加,並使其顯示的問題是對還是錯,但我不能讓比分更新,也沒有人知道我怎樣才能得到這些問題刷新到另外一個問題,我想app.update:有誰知道如何有一個分數通過標籤
self.a1button = Tkinter.Button(self, background="blue",foreground="white", text = (random_row.A1), command = self.QUESTION1)
self.a1button.grid(row = 9, column = 1, sticky = 'W')
self.label5 = Tkinter.Label(self, text = "Score:")
self.label5.grid(row = 14, column = 1, columnspan = 5, sticky = 'S')
self.label7 = Tkinter.Label(self, text = 0)
self.label7.grid(row = 14, column = 6, columnspan = 1, sticky = 'E')
def QUESTION1(self):
if self.a1button['text'] == self.label6['text']:
tkMessageBox.showinfo("CORRECT", "WELL DONE")
label7 = +100
app.refresh
else:
tkMessageBox.showinfo("INCORRECT", "YOU FULLY GOT IT WRONG :/")
label7 = -100
app.refresh