【发布时间】:2021-07-19 22:20:43
【问题描述】:
我想接受用户输入并在 GUI 中输出... 我的代码
from tkinter import *
root = Tk()
root.geometry("644x344")
def printSomething():
label = Label(root, text="???")
label.grid(row=1, column=2)
ok=Label(root, text="Type your name").grid(row=2,column=1)
entryvalue = StringVar()
entry= Entry(root, textvariable=entryvalue)
entry.grid(row=2, column=2)
button = Button(root, text="Print Me", command=printSomething)
button.grid(row=3, column=2)
root.mainloop()
【问题讨论】:
标签: python tkinter pycharm tkinter-entry