//须在python环境下才可实现,新建任何一种可以写文字的文件,完成后改成py后缀即可
//代码中的汉字可以随意改成自己想要的,“for i in range(10)”此处的10即为“轰炸的次数”,也可改成自己想的次数,建议不要改的太大,不然真炸了
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('新年快乐')
window.geometry("400x100"+"+"+str(a)+"+"+str(b))
tk.Label(window,
text='新年快乐!!!',
bg='pink',
font=('楷体',23),
width=40,height=15).pack()
window.mainloop()
threads=[]
for i in range(10):
t=threading.Thread(target=dow)
threads.append(t)
time.sleep(0.1)
threads[i].start()