我收到AttributeError:当我在ttk标签中使用绑定功能时,'NoneType'对象没有属性'bind'错误
window = tk.Tk()
window.title("GUI")
window.minsize(640,400)
labelFrame = ttk.LabelFrame(tab1)
labelFrame.grid(row=0,column = 0,padx =8, pady =10)
L2 = ttk.Label(labelFrame, text="Training File",font = "Helvetica 14",foreground = 'Dark green')
L2 = L2.grid(row=2,column=0)
L2.bind('<Enter>', command = fun12)
L2.bind('<Leave>', fun21)
def fun12(event):
L2.config(text="Enter variables")
def fun21(event):
L2.config(text="More info")