最近闲着无聊,写了个简单的无限弹窗,给你们看看😁
# -*-coding:utf-8 -*-
# @Time :2022/5/26 20:45
# 弹窗恶搞程序
import tkinter as tk
import random
import threading
import time
import winsound
def boom():
window = tk.Tk()
width = window.winfo_screenwidth()
height = window.winfo_screenheight()
# 高,宽进行随机值
a = random.randrange(0, width)
b = random.randrange(0, height)
# 在界面出现随机弹窗和字体
window.title('Windows系统提示')
window.geometry("400x100" + "+" + str(a) + "+" + str(b))
# 设置告警内容
tk.Label(window, text='错误,Windows正遭受蔡徐坤和鸡你太美攻击!', bg='red',
font=('宋体', 17), width=40, height=4).pack()
winsound.MessageBeep(winsound.MB_ICONASTERISK)
window.mainloop()
def lu():
TK = tk.Tk()
width = TK.winfo_screenw