复制,然后新建一个File(在应用的左上角有个File,在下面的第一个的New File,点一下)在新的文件里复制我的代码,然后(黏)贴(选中你的代码,在键盘的左下角有个Ctrl(Ctrl+c复制)再到你的文件里(Ctrl+v(黏)贴))好了之后按F5,有个弹窗点确定,这是个保存(你想保存到哪我不管)然后就好了
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("200x50"+"+"+str(a)+"+"+str(b))
tk.Label(window,
text='祝你生日快乐!', # 标签的文字
bg='Red', # 背景颜色
font=('楷体', 17), # 字体和字体大小
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()
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("200x50"+"+"+str(a)+"+"+str(b))
tk.Label(window,
text='祝你生日快乐!', # 标签的文字
bg='Red', # 背景颜色
font=('楷体', 17), # 字体和字体大小
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()