1. 程式人生 > >python學習之圖形界面編程:

python學習之圖形界面編程:

rom 復雜 targe 布局 grid port idg http 實現

一 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學習之圖形界面編程: