我用tkinter用Python3.6.2编写了一个程序,编写了以下代码:
from tkinter import *
root=Tk()
def retrieve_input():
inputValue=textBox.get("1.0","end-1c")
print(inputValue)
textBox=Text(root, height=2, width=10)
textBox.pack()
buttonCommit=Button(root, height=1, width=10, text="Commit",
command=lambda: retrieve_input())
buttonCommit.pack()
mainloop()
我想在文本框中按回车键打印“你在文本框中按回车”。 如何编写事件?在
看看这个
现在它只能在文本框中工作。。。在
相关问题 更多 >
编程相关推荐