xinxin - 初步学习tkinter

import tkinter
import time
# 初始化
mywindow = tkinter.Tk()
# 设置标题 title
mywindow.title("wxx")
# 设置大小
mywindow.geometry("500x600")
# 设置一个标签   label
a = 1
def dian():
    global a
    a = a + 1
    la['text'] = "点赞人数%d"%a


la = tkinter.Label(
    mywindow,
    text="点赞人数",
    bg="#9ACD32",  # bg background
    fg="black",  # front ground
    font = ("None 30 bold"),
    width = 10,
    height = 5,
    bd = 10
)
# 把标签放到窗口上
la.pack()
# 按钮  button
btn = tkinter.Button(
    mywindow,
    text = "点赞",
    bg = "black",
    fg = "pink",
    font = ("None 20 bold"),
    width = 5,
    height = 3,
    bd =10,
    command = dian
)
btn.pack()



# 循环显示我们的窗口
mywindow.mainloop()
import tkinter

chuangkou = tkinter.Tk()
chuangkou.title("hls")
chuangkou.geometry("1600x1200")
la = tkinter.Label(
    chuangkou,
    text="你的电脑中病毒了",
    bg="black",
    fg="#00FF7F",
    font = ('None 100 bold'),
    width = 100,
    height = 50,
    bd = 10,
)
la.pack()
chuangkou.mainloop()
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值