Python 窗體(tkinter)按鈕 位置實(shí)例
更新時(shí)間:2019年06月13日 19:58:13 作者:houyanhua1
今天小編就為大家分享一篇Python 窗體(tkinter)按鈕 位置實(shí)例,具有很好的參考價(jià)值,希望對大家有所幫助。一起跟隨小編過來看看吧
如下所示:
import tkinter
def go(): #函數(shù)
print("go函數(shù)")
win=tkinter.Tk() #構(gòu)造窗體
win.title("hello zhaolin")#標(biāo)題
win.geometry("800x800+300+0")#800寬度,800高度,x,y坐標(biāo),左上角
button=tkinter.Button(win,text="有種點(diǎn)我",command=go) #收到消息執(zhí)行g(shù)o函數(shù)
button.pack()#加載到窗體,
button1=tkinter.Button(win,text="有種點(diǎn)",command= lambda :print("hello world"),width=20,height=10)
button1.pack()#加載到窗體,
#button.place(10,10)
win.mainloop() #進(jìn)入消息循環(huán)機(jī)制
以上這篇Python 窗體(tkinter)按鈕 位置實(shí)例就是小編分享給大家的全部內(nèi)容了,希望能給大家一個參考,也希望大家多多支持腳本之家。
相關(guān)文章
Python+matplotlib實(shí)現(xiàn)量場圖的繪制
matplotlib是基于Python語言的開源項(xiàng)目,pyplot提供一系列繪制2D圖形的方法。本文將帶大家學(xué)習(xí)matplotlib.pyplot.quiver()相關(guān)方法屬性并通過其繪制量場圖2021-12-12
python實(shí)現(xiàn)字符串完美拆分split()的方法
今天小編就為大家分享一篇python實(shí)現(xiàn)字符串完美拆分split()的方法,具有很好的參考價(jià)值,希望對大家有所幫助。一起跟隨小編過來看看吧2019-07-07

