3 TKinter设置宽高及背景色


 

代码示例

#!/usr/bin/env python
# _*_ coding:utf-8 _*_
from Tkinter import *
root = Tk()
B1 = Button(root,text='按扭一')
B2 = Button(root,text='按扭二')
B1['height']=5
B1['width']=20
B2['height']=5
B2['width']=18
B2['background']='green'
B1.pack()
B2.pack()
root.mainloop()

  效果图

 


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM