【发布时间】:2014-04-12 18:01:46
【问题描述】:
我不确定这里是否适合提出这样的问题,但作为一名新的 Python 开发者,我希望有人向我解释 Python 的 Tkinter 小程序。
程序:
from Tkinter import *
master = Tk()
e = Entry(master)
e.pack()
root = Tk()
text = Text(root)
e.focus_set()
text.pack()
def callback():
text.insert(INSERT, e.get())
b = Button(master, text="Start", width=10, command=callback)
b.pack()
mainloop()
root.mainloop()
这个程序运行良好,但遵循here 的文档,我仍然对一些事情感到困惑。
- 什么是 Enter(主)
- e.pack()
- 文本(根)
- text.pack()
- 主循环()
- root.mainloop()
谢谢!!!
【问题讨论】: