一个<>按一次Tab键,两个<>按两次Tab键
import tkinter as tk
import random
def show_warm_tip():
<>window = tk.Toplevel()
<>window.attributes('-topmost', False)
<>window.attributes('-alpha', 0.9)
<>screen_width = window.winfo_screenwidth()
<>screen_height = window.winfo_screenheight()
<>window_width = 250
<>window_height = 60
<>x = random.randrange(0, screen_width - window_width)
<>y = random.randrange(0, screen_height - window_height)
<>window.title('synb')
<>window.geometry(f"{window_width}x{window_height}+{x}+{y}")
<>tips = ['少羽牛逼' ]
<>tip = random.choice(tips)
<>bg_colors = ['lightpink', 'skyblue', 'lightgreen', 'lavender']
<>bg = random.choice(bg_colors)
<>label = tk.Label(
<><>window,
<><>text=tip,
<><>bg=bg,
<><>font=('微软雅黑', 16),
<><>width=30,
<><>height=3,
<><>justify=tk.CENTER)
<>label.pack()
<>window.after(10, show_warm_tip)
if __name__ == "__main__":
<>root = tk.Tk()
<>root.withdraw()
<>show_warm_tip()
<>root.mainloop()