当前位置: 首页 > news >正文

Python满屏表白代码

目录

前言

爱心界面 

无限弹窗 


前言

人生苦短,我用Python!又是新的一周啦,本期博主给大家带来了一个全新的作品:满屏表白代码,无限弹窗版!快快收藏起来送给她吧~

爱心界面 

def Heart():
    root=tk.Tk()
    screenwidth=root.winfo_screenwidth()
    screenheight=root.winfo_screenheight()
    width=600
    height=400
    x=(screenwidth-width)//2
    y=(screenheight-height)//2
    root.title("❤")
    root.geometry("%dx%d+%d+%d"%(screenwidth,screenheight,0,0))
    tk.Label(root,text='❤',fg='pink',bg='white',font=("Comic Sans MS",500),width=300,height=20).pack()
    root.mainloop()    

无限弹窗 

def Love1():
    root=tk.Tk()
    width=200
    height=50
    screenwidth=root.winfo_screenwidth()
    screenheight=root.winfo_screenheight()
    x=ra.randint(0,screenwidth/2)
    y=ra.randint(0,screenheight/2)
    root.title("❤")
    root.geometry("%dx%d+%d+%d"%(width,height,x,y))
    tk.Label(root,text='I LOVE YOU!',fg='white',bg='pink',font=("Comic Sans MS",15),width=30,height=5).pack()
    root.mainloop()
def Love2():
    root=tk.Tk()
    width=200
    height=50
    screenwidth=root.winfo_screenwidth()
    screenheight=root.winfo_screenheight()
    screenheight-=2*width
    x=ra.randint(screenwidth/2,screenwidth)
    y=ra.randint(0,screenheight/2)
    root.title("❤")
    root.geometry("%dx%d+%d+%d"%(width,height,x,y))
    tk.Label(root,text='I LOVE YOU!',fg='white',bg='pink',font=("Comic Sans MS",15),width=30,height=5).pack()
    root.mainloop()
def Love3():
    root=tk.Tk()
    width=200
    height=50
    screenwidth=root.winfo_screenwidth()
    screenheight=root.winfo_screenheight()
    screenheight-=width
    x=ra.randint(screenwidth/2,screenwidth)
    y=ra.randint(screenheight/2,screenheight)
    root.title("❤")
    root.geometry("%dx%d+%d+%d"%(width,height,x,y))
    tk.Label(root,text='I LOVE YOU!',fg='white',bg='pink',font=("Comic Sans MS",15),width=30,height=5).pack()
    root.mainloop()
def Love4():
    root=tk.Tk()
    width=200
    height=50
    screenwidth=root.winfo_screenwidth()
    screenheight=root.winfo_screenheight()
    screenheight-=2*width
    x=ra.randint(0,screenwidth/2)
    y=ra.randint(screenheight/2,screenheight)
    root.title("❤")
    root.geometry("%dx%d+%d+%d"%(width,height,x,y))
    tk.Label(root,text='I LOVE YOU!',fg='white',bg='pink',font=("Comic Sans MS",15),width=30,height=5).pack()
    root.mainloop()

http://www.lryc.cn/news/43257.html

相关文章:

  • Spring学习流程介绍
  • 杭银消金基于 Apache Doris 的统一数据查询网关改造
  • Flink学习笔记(六)Time详解
  • 「Vue面试题」在项目中你是如何解决跨域的?
  • java八股文--数据库
  • vue中名词解释
  • 基于Java+SSM+Vue的旅游资源网站设计与实现【源码(完整源码请私聊)+论文+演示视频+包运行成功】
  • 用于人工智能研究的开源Python微电网模拟器pymgrid(入门篇)
  • 运算放大器:电压比较器、电压跟随器、同相比例放大器
  • Vector - CAPL - 实时时间on *(续2)
  • 数据质量管理的四个阶段
  • Spring源码面试最难问题——循环依赖
  • 【计组】RAM的深入理解
  • JavaScript 之数据交互
  • Python 十大开源Python库,看看你熟悉几个?
  • 不愧是阿里开发的SpringBoot实战文档:入门+基础+进阶+项目,应有尽有
  • Vue(3)-vue中的Ajax、Vuex、路由及UI组件库
  • jwt 学习笔记
  • 网络安全实战从 0 到 1 彻底掌握 XXE
  • 如何安装 Composer
  • WPF 常用控件
  • 河南工程学院蓝桥培训(2.21)
  • 新人使用Git获取远程仓库项目
  • 理解信号的
  • SpringSecurity学习(七)授权
  • 【Vue3】模板语法
  • Linux基础
  • Spark-序列化、依赖关系、持久化
  • 蓝桥杯刷题冲刺 | 倒计时16天
  • Java设计模式-12 、建造者模式