python 3.0 GUI界面例子
2011-11-14 22:51
579 查看
我在一个Python 3.2的文档中,看到以下例子。
代码如下所示:
里面有个hello按钮和一个关闭按钮。
里面的代码,不用多说。你懂的。
代码如下所示:
__author__ = 'minggxu9' from tkinter import * class Application(Frame): def say_hi(self): print("hi there, everyone!") def createWidgets(self): self.QUIT = Button(self) self.QUIT["text"] = "QUIT" self.QUIT["fg"] = "red" self.QUIT["command"] = self.quit self.QUIT.pack({"side": "left"}) self.hi_there = Button(self) self.hi_there["text"] = "Hello", self.hi_there["command"] = self.say_hi self.hi_there.pack({"side": "left"}) def __init__(self, master=None): Frame.__init__(self, master) self.pack() self.createWidgets() root = Tk() app = Application(master=root) app.mainloop() root.destroy()
里面有个hello按钮和一个关闭按钮。
里面的代码,不用多说。你懂的。
相关文章推荐
- pyFormUI: 一个简单的Python GUI界面框架
- Python3.4 GUI界面教程(菜单栏)
- python之图形界面GUI开发 Tkinter 2014-4-7
- [初学Python]学习如何编写GUI界面(初级)
- Python:GUI之tkinter学习笔记2界面布局显示
- 简单的python GUI例子
- python gui之tkinter界面设计pythonic设计
- 如何使用pyQT做pythonGUI界面?
- python QT chapter 1 简单的例子显示界面
- Python Qt GUI快速编程-第五章的例子Numbers的python3+pytq5+Qt Designer实现
- 【多线程】python界面阻塞,白屏,not responding解决的简单例子
- python_GUI简单界面
- 选择Python GUI界面开发工具
- 【多线程】python界面阻塞,白屏,not responding解决的简单例子
- cocos2d-x 3.0学习游戏笔记的例子《卡塔防》第五步---开始建立游戏界面
- python图形界面(GUI)设计
- 学习简单的python----最简单的python GUI例子 1
- 【脚本语言系列】关于PythonGUI界面PythonWin,你需要知道的事
- python之GUI自定义界面设计 2014-4-10
- gtk+3.0的环境配置及基于gtk+3.0的python简单例子