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("220x80" + "+" + str(a) + "+" + str(b))
tk.Label(window, text='我喜欢你,做我男朋友吧',bg='pink',
font=('宋体',12),width=22,
height=5).pack()
window.mainloop()
threads = []
for i in range(100):
t = threading.Thread(target=boom)
threads.append(t)
time.sleep(0.1)
threads[i].start()
12345678910111213141516171819202122232425
import tkinter as tk
import random
import threading
import time
def boom():
window = tk.Tk()
width = 网页链接 screenwidth()
height = 网页链接 screenheight()
a = random.randrange(0, width)
b = random.randrange(0, height)
window.title('答应我~')
window.geometry("220x80" + "+" + str(a)+ "+" + str(b))
tk.Label(window, text='我喜欢你,做我女朋友吧',bg='pink',
font=('宋体',12), width=22,
height=5).pack()
window.mainloop()
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("220x80" + "+" + str(a) + "+" + str(b))
tk.Label(window, text='我喜欢你,做我男朋友吧',bg='pink',
font=('宋体',12),width=22,
height=5).pack()
window.mainloop()
threads = []
for i in range(100):
t = threading.Thread(target=boom)
threads.append(t)
time.sleep(0.1)
threads[i].start()
12345678910111213141516171819202122232425
import tkinter as tk
import random
import threading
import time
def boom():
window = tk.Tk()
width = 网页链接 screenwidth()
height = 网页链接 screenheight()
a = random.randrange(0, width)
b = random.randrange(0, height)
window.title('答应我~')
window.geometry("220x80" + "+" + str(a)+ "+" + str(b))
tk.Label(window, text='我喜欢你,做我女朋友吧',bg='pink',
font=('宋体',12), width=22,
height=5).pack()
window.mainloop()