|
|
import tkinter as tkfrom tkinter import messageboxroot = tk.Tk()root.title("爱国主义小程序")root.geometry("400x300")label = tk.Label(root, text="热爱祖国,为祖国的繁荣富强而努力!", font=("Arial", 16))label.pack(pady=50)def show_patriotic_quote(): quote = "天下兴亡,匹夫有责。——顾炎武" messagebox.showinfo("爱国主义名言", quote)button = tk.Button(root, text="点击查看爱国主义名言", command=show_patriotic_quote)button.pack(pady=20)root.mainloop()
|
|