您的位置:首页 > 编程语言 > Python开发

python核心编程-GUI程序按钮与标签

2016-01-22 21:47 721 查看
#!/usr/bin/env python
# -*- coding: UTF-8 -*-

import Tkinter

top = Tkinter.Tk()
hello = Tkinter.Label(top, text = 'hello world!')
hello.pack()

quit = Tkinter.Button(top, text='QUIT', command=top.quit, bg='red', fg='white')
quit.pack(fill=Tkinter.X, expand=1)

Tkinter.mainloop()


输出:

内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: