import tkinter as tk from tkinter import messagebox from JJXX import create_main_window from HJJC import aaa def create_main_page(root): home_info_title = tk.Label(root, text="功能区", font=("Helvetica", 16)) home_info_title.pack(pady=20) goto_jiaju_button = tk.Button(root, text="家居信息", command=lambda: JiaJuInfoPage(root)) goto_jiaju_button.pack(pady=10) goto_jiance_button = tk.Button(root, text="环境监测", command=lambda: JianCeInfoPage(root)) goto_jiance_button.pack(pady=10) def JiaJuInfoPage(master): create_main_window() def JianCeInfoPage(master): aaa() def a(): root = tk.Tk() root.title('智能家居系统-主界面') root.geometry('600x400') create_main_page(root) root.mainloop() if __name__ == '__main__': a()