【发布时间】:2021-11-19 21:35:41
【问题描述】:
from tkinter import *
root = Tk()
root.title("Matchstick Game")
root.iconbitmap("match.ico")
root.geometry("1000x580")
H = Entry(root, width = 80, fg = 'red').pack()
def clickme():
mylabel = Label(root, text = "Hello" + H.get()).pack()
my_button = Button(root, text = "whats your name",
padx=10,pady=10,bg='white',fg='green',command=clickme).pack()
root.mainloop()
我收到此错误:AttributeError: 'NoneType' object has no attribute 'get'
【问题讨论】:
标签: python python-3.x tkinter tkinter-entry