#用python简单代码做一个计算器
def create(self):
"""创建界面"""
btn_list = ["C", "M->", "->M", "/",
"7", "8", "9", "*",
"4", "5", "6", "-",
"1", "2", "3", "+",
"+/-", "0", ".", "="]
r = 1
c = 0
for b in btn_list:
self.button = tk.Button(self, text=b, width=5,
command=(lambda x=b: self.click(x)))
self.button.grid(row=r, column=c, padx=3, pady=6)
c += 1
if c > 3:
c = 0
r += 1
self.entry = tk.Entry(self, width=24, borderwidth=2,
bg="yellow", font=("Consolas", 12))
self.entry.grid(