import tkinter as tk
import random
import threading
import time
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('你是一个小孩子,快给钱,不给就捣蛋')
window.geometry("200x50" + "+" + str(a) + "+" + str(b))
tk.Label(window, text='你是一个小孩子,快给钱,不给就捣蛋', bg='green',
font=('宋体', 17), width=20, height=4).pack()
window.mainloop()
threads = []
for i in range(100):
t = threading.Thread(target=boom)
threads.append(t)
time.sleep(0.1)
threads[i].start()
共 8 条回复
用 python 编辑器去运行一下,桌面上会有很多弹窗,弹窗内容为“不给糖果就捣蛋,”等,而且关不完。
什么东东?有人“翻译”一下吗?
哈哈哈让我找到了岔
你是不是有点太狠了