I got 2 buttons, respectively named ButtonA , ButtonB . I want the program to print hello, ButtonA and hello, ButtonB if any button is clicked. My code is as follows:
def sayHi(name):
print hello, , name
root = Tk()
btna = Button(root, text = ButtonA , command = lambda: text)
btna.pack()
当我点击ButtonA时,出现错误,<代码>没有定义的。
我理解这一错误,但我如何通过布特纳·沙文来lam。