我收到 ButtonClick 方法内任何函数的属性错误。请帮助纠正这个问题。
import tkinter as tk
from tkinter import *
root = tk.Tk()
enter = tk.Entry(root, width = 35, borderwidth = 5).grid(row = 0, column = 0, columnspan = 3, padx =10 , pady = 10)
def ButtonClick(number):
print(number)
current = enter.get()
print(current)
# enter.delete(0,END)
# enter.insert(0, current + number)
button1 = tk.Button(root, text="1", bg="yellow",padx = 40, pady= 20, command=lambda: ButtonClick(1)).grid(row = 1, column = 0)
root.mainloop()
森栏
相关分类