ziheng -计算器

import tkinter as tk
window = tk.Tk()
window.geometry("280x500")
window.title("计算器")

# 显示结果
la1 = tk.Label(
    window,
    font=(None,30),
    bg="#0000CD",
    fg="white",
    bd=1,
    anchor="se",# 锚  north北  east 东   west西  south 南
    text="显示结果"
)
la1.place(x=0, y=0, width=280,height=170)
# 显示公式
la2 = tk.Label(
    window,
    font = (None,30),
    bg = "#0000FF",
    fg = "#7B68EE",
    bd = 1,
    anchor = "se",
    text = "显示公式"
)
la2.place(x = 0,y = 170,width = 280,height = 60)
# 写一个按钮
btnAC = tk.Button(
    window,
    text="AC",
    font=(None,20),
    fg="#00BFFF",
)
btnAC.place(x=0, y=230,width=70,height=55)

bthx = tk.Button(
    window,
    text = "*",
    font = (None,20),
    fg = "#87CEFA",
)
bthx.place(x = 210,y = 230,width = 70,height = 55)
bth7 = tk.Button(
    window,
    text="7",
    font=(None, 20),
    fg="#87CEFA",
)
bth7.place(x=0, y=285, width=70, height=55)

bthc = tk.Button(
    window,
    text="/",
    font=(None, 20),
    fg="#87CEFA",
)
bthc.place(x = 140, y = 230, width=70, height=55)


window.mainloop()
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值