首页 > 代码库 > python学习之图形界面编程:

python学习之图形界面编程:

一 tkinter:tkinter是python自带的支持tk的库,python代码调用tkinter->tk->操作系统提供的本地GUI(TKL语言开发))完成界面开发,不需要安装任何第三方程序。Tkinter教程第二版https://link.zhihu.com/?target=http%3A//pan.baidu.com/s/1hr6ortE,Python GUI Programming Cookbook:https://link.zhihu.com/?target=http%3A//pan.baidu.com/s/1eSimgQA

第一步是导入Tkinter包的所有内容:
from tkinter import *
第二步是从Frame派生一个Application类,这是所有Widget的父容器

class Application(Frame):

pack()是最简单的
布局,grid()可以实现更复杂的布局

python学习之图形界面编程: