這篇文章主要介紹python tkinter實(shí)現(xiàn)畫(huà)出計(jì)算器界面的示例,文中介紹的非常詳細(xì),具有一定的參考價(jià)值,感興趣的小伙伴們一定要看完!
成都創(chuàng)新互聯(lián)主營(yíng)廣陵網(wǎng)站建設(shè)的網(wǎng)絡(luò)公司,主營(yíng)網(wǎng)站建設(shè)方案,app軟件開(kāi)發(fā)公司,廣陵h5微信小程序定制開(kāi)發(fā)搭建,廣陵網(wǎng)站營(yíng)銷推廣歡迎廣陵等地區(qū)企業(yè)咨詢
需求:設(shè)計(jì)能計(jì)算加法的計(jì)算器界面
代碼演示:
from tkinter import * # 創(chuàng)建窗體 root = Tk() #添加標(biāo)題 root.title("求兩數(shù)之和") root.geometry("700x80") photo = PhotoImage(file = "/Users/yushengtan/Desktop/calc.png") PhotoLabel = Label(root,image = photo).pack(side = LEFT,padx = 10,pady = 5) #文本框 Entry01 = Entry(root,bg = "pink",width = 10,font = ("黑體",20)).pack(side = LEFT,padx = 5,pady = 5) Label_plus = Label(root,text = "+",font = ("黑體",20)).pack(side = LEFT,padx = 5,pady = 5) #文本框 Entry02 = Entry(root,bg = "pink",width = 10,font = ("黑體",20)).pack(side = LEFT,padx = 5,pady = 5) Label_equal = Label(root,text = "=",font = ("黑體",20)).pack(side = LEFT,padx = 5,pady = 5) #文本框 Entry03 = Entry(root,bg = "green",width = 10,font = ("華文黑體",20)).pack(side = LEFT,padx = 5,pady = 5) Button01 = Button(root,text = "計(jì)算",width = 10,height = 2,font = ("華文黑體",15)).pack(side = LEFT,padx = 10,pady = 5) # 運(yùn)行 root.mainloop()
運(yùn)行效果演示:
以上是python tkinter實(shí)現(xiàn)畫(huà)出計(jì)算器界面的示例的所有內(nèi)容,感謝各位的閱讀!希望分享的內(nèi)容對(duì)大家有幫助,更多相關(guān)知識(shí),歡迎關(guān)注創(chuàng)新互聯(lián)行業(yè)資訊頻道!
文章題目:pythontkinter實(shí)現(xiàn)畫(huà)出計(jì)算器界面的示例
文章位置:http://jinyejixie.com/article28/pdchcp.html
成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供軟件開(kāi)發(fā)、網(wǎng)站策劃、面包屑導(dǎo)航、網(wǎng)站設(shè)計(jì)、移動(dòng)網(wǎng)站建設(shè)、定制開(kāi)發(fā)
聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請(qǐng)盡快告知,我們將會(huì)在第一時(shí)間刪除。文章觀點(diǎn)不代表本網(wǎng)站立場(chǎng),如需處理請(qǐng)聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時(shí)需注明來(lái)源: 創(chuàng)新互聯(lián)