import tkinter as tk
import random as ra
def tanchaung():
root = tk.Tk()
width = 200
height = 50
screenwidth = root.winfo_screenwidth()
screenheight = root.winfo_screenheight()
x = ra.randint(0, screenwidth)
y = ra.randint(0, screenheight)
root.title("⭐")
root.geometry("%dx%d+%d+%d" % (width, height, x, y))
tk.Label(root, text='元旦快乐!', fg='gold', bg='red', font=("行楷", 20), width=30, height=5).pack()
root.mainloop(32)#设置个数
while (1):
tanchaung()