新聞中心
這里有您想知道的互聯(lián)網(wǎng)營銷解決方案
創(chuàng)新互聯(lián)Python教程:python如何創(chuàng)建GUI程序
創(chuàng)建步驟

(1)import Tkinter
(2)創(chuàng)建頂層窗口對象容納 GUI: top = Tkinter.Tk()
(3)在 top 中創(chuàng)建所有的 GUI 模塊
(4)將GUI 模塊與底層代碼相連接
(5)進入主事件循環(huán)
實例
A Tkinter example: “Hello world!” : from Tkinter import * #導入 Tkinter top = Tk() #頂層窗口 label = Label(top, text=’Hello world!’) #創(chuàng)建模塊 label.pack() #裝載連接 mainloop() #主事件循環(huán)
以上就是python創(chuàng)建GUI程序的方法,希望對大家有所幫助。更多Python學習指路:創(chuàng)新互聯(lián)python教程
本文教程操作環(huán)境:windows7系統(tǒng)、Python 3.9.1,DELL G3電腦。
本文題目:創(chuàng)新互聯(lián)Python教程:python如何創(chuàng)建GUI程序
標題網(wǎng)址:http://m.5511xx.com/article/cogpihe.html


咨詢
建站咨詢
