# 已测试有效 import tkinter as tk class App(tk.Tk): pass app = App() app.attributes('-topmost', True) app.mainloop()