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()

  效果图

 

posted on 2016-12-08 11:39  孔扎根  阅读(14676)  评论(0编辑  收藏  举报

导航