from tkinter import *
root = Tk()
def printName(event):
name = input("what is your name?")
print("My name is" + name)
printButton = Button(root,text = "Cliek Me")
printButton.bind("<Button-1>",printNme)
printButton.pack()
root.mainloop()
答案 0 :(得分:0)
以下代码可以解决您的问题。根据您的代码要求,在引号内填空。
from tkinter import *
root = Tk()
def printName():
name = input("what is your name?")
print("My name is" + "")
printButton = Button(root, text="Cliek Me")
printButton.bind("<Button-1>", "")
printButton.pack()
root.mainloop()
printName()