📜  弹出窗口 python tkinter - Python 代码示例

📅  最后修改于: 2022-03-11 14:46:36.401000             🧑  作者: Mango

代码示例1
import tkinter as tk

def popupmsg(msg, title):
    root = tk.Tk()
    root.title(title)
    label = ttk.Label(root, text=msg)
    label.pack(side="top", fill="x", pady=10)
    B1 = tk.Button(root, text="Okay", command = root.destroy)
    B1.pack()
    popup.mainloop()