七夕表白弹窗Python源码
我的站长站
2023-08-22
共人阅读
七夕表白弹窗Python源码是一种用于在七夕节期间向用户展示表白信息的网页弹窗。该源码使用Python语言编写,可以生成具有浪漫氛围的弹窗界面,帮助用户表达自己的心意。
import tkinter as tk
import random
import threading
import time
def dow():
window = tk.Tk()
width=window.winfo_screenwidth()
height=window.winfo_screenheight()
a=random.randrange(0,width)
b=random.randrange(0,height)
window.title('520快乐')
window.geometry("200x50"+"+"+str(a)+"+"+str(b))
tk.Label(window,
text='亲爱的嫁给我吧!', # 标签的文字
bg='Red', # 背景颜色
font=('楷体', 15), # 字体和字体大小
width=15, height=2 # 标签长宽
).pack() # 固定窗口位置
window.mainloop()
threads = []
for i in range(100):#需要的弹框数量
t = threading.Thread(target=dow)
threads.append(t)
time.sleep(0.1)
threads[i].start()