Tk on Python

来源:互联网 发布:java中什么是方法重载 编辑:程序博客网 时间:2024/06/07 18:27

#导入Tk interface

#创建根窗口

#在根窗口上创建所有GUI模块

#将GUI模块与底层程序代码link起来

#mainloop()


#coding:utf-8
import Tkinter as Tk
#实例化一个根窗口
root=Tk.Tk()
#创建其他widget
label=Tk.Label(root,text='hehe')
button=Tk.Button(root,text='quit',command=root.quit)
#使用packer将组件绑定到root上面
label.pack()
button.pack()
#循环监听窗口事件
Tk.mainloop()

0 0