所以我正在尝试制作某种基本的自动点击器,其排名会在一定数量的点击后更新,但是每当我更新排名时,应该显示的标签不会改变,我不知道如何进行标签更新
from tkinter import *
count = 0
rank = "click the button to rank up!"
window = Tk()
if count == 1:
rank = "wow first click!"
def click():
global count
count += 1
counter = Label(window, text=count).grid(row = 0, column = 1)
clicker = Button(window, text="The Button", padx = 50, pady = 50, command = click).grid(row = 0, column = 0)
rankDisplay = Label(window, text = rank, padx = 100, pady = 25).grid(row = 1, column = 0)
window.mainloop()
第一次点击后,排名仍然显示为“点击按钮排名上升”而不是“哇第一次点击”,这几乎是问题