#grid布局.py
from tkinter import *
root=Tk()
root.title('计算器示例')
root.geometry('300x150+280+280')
root.config(bg='#cc66ff')
L1=Button(root,text='1',width=5,bg='yellow')
L2=Button(root,text='2',width=5,bg='red')
L3=Button(root,text='3',width=5,bg='blue')
L4=Button(root,text='4',width=5,bg='blue')
L5=Button(root,text='5',width=5,bg='green')
L6=Button(root,text='6',width=5,bg='red')
L7=Button(root,text='7',width=5,bg='green')
L8=Button(root,text='8',width=5,bg='pink')
L9=Button(root,text='9',width=5,bg='blue')
L0=Button(root,text='0',width=10,bg='y