The following is main\_GUI module:

import tkinter as tk
from tkinter import ttk
from ttkthemes import ThemedTk
import load\_preprocess as lp
import visualisations as vi
class App:
 def \_\_init\_\_(self, master):
 self.master = master
 master.title("GUI Application")
 
 # set the minimum window size
 master.minsize(width=400, height=300)
 
 # create a frame for the text widget
 text\_frame = ttk.Frame(master, padding=10)
 text\_frame.pack(expand=True, fill='both')
 
 # create the text widget and disable editing
 self.text\_widget = tk.Text(text\_frame, wrap='word', state='disabled')
 self.text\_widget.pack(expand=True, fill='both')
 
 # create a frame for the buttons
 button\_frame = ttk.Frame(master, padding=10)
 button\_frame.pack(side='bottom', fill='x')
 
 # create the buttons
 load\_data\_button = ttk.Button(button\_frame, text="Load Data", command=self.load\_data)
 data\_analysis\_button = ttk.Button(button\_frame, text="Data Analysis", command=self.data\_analysis)
 generate\_models\_button = ttk.Button(button\_frame, text="Generate Models", command=self.generate\_models)
 predict\_data\_button = ttk.Button(button\_frame, text="Predict Data", command=self.predict\_data)
 model\_validation\_button = ttk.Button(button\_frame, text="Model Validation", command=self.model\_validation)
 Exit\_button=ttk.Button(button\_frame, text="Exit", command=self.master.destroy)
 
 # grid the buttons
 load\_data\_button.grid(row=0, column=0, padx=5, pady=5, sticky='ew')
 data\_analysis\_button.grid(row=0, column=1, padx=5, pady=5, sticky='ew')
 generate\_models\_button.grid(row=0, column=2, padx=5, pady=5, sticky='ew')
 predict\_data\_button.grid(row=1, column=0, padx=5, pady=5, sticky='ew')
 model\_validation\_button.grid(row=1, column=1, padx=5, pady=5, sticky='ew')
 Exit\_button.grid(row=1, column=2, padx=5, pady=5, sticky='ew')
 
 def load\_data(self):
 lp.load\_data()
 self.text\_widget.config(state="normal")
 self.text\_widget.insert("end", "Load Data button clicked\n")
 self.text\_widget.config(state="disabled")
 
 def data\_analysis(self):
 visual\_window = tk.Toplevel(self.master)
 visual\_window.title("Generate Models")
 visual\_window.geometry('600x400')

 graphs=vi.create\_graphs(lp.df)

 # Create a dropdown menu for selecting the type of graph
 graph\_type\_var = tk.StringVar(visual\_window)
 graph\_type\_var.set("plot\_1") # Set the initial value
 graph\_type\_options = ["plot\_1", "plot\_2", "plot\_3","plot\_4","plot\_5","plot\_6"] # Available options
 graph\_type\_dropdown = tk.OptionMenu(visual\_window, graph\_type\_var, \*graph\_type\_options)
 graph\_type\_dropdown.pack()

 vi.visualize(visual\_window,graph\_type\_var,graphs)
 
 # enable the text widget to display messages
 self.text\_widget.config(state="normal")
 self.text\_widget.insert("end", "Data Analysis button clicked\n")
 self.text\_widget.config(state="disabled")
 
 def generate\_models(self):
 # create a new window
 prompt\_window = tk.Toplevel(self.master)
 prompt\_window.title("Generate Models")
 prompt\_window.geometry('250x250')
 self.prompt\_window=prompt\_window
 # create a frame for the widgets
 frame = ttk.Frame(prompt\_window, padding=10)
 frame.pack(expand=True, fill='both')
 prompt\_window.bind('<>', lambda event:prompt\_window.destroy)
 
 # create the preprocess data checkbutton
 self.preprocess\_data\_var = tk.BooleanVar()
 preprocess\_data\_checkbutton = ttk.Checkbutton(frame, text="Preprocess Data", variable=self.preprocess\_data\_var)
 preprocess\_data\_checkbutton.grid(row=0, column=0, padx=5, pady=5, sticky='w')
 
 # create the save test data checkbutton
 self.save\_test\_data\_var = tk.BooleanVar()
 save\_test\_data\_checkbutton = ttk.Checkbutton(frame, text="Split & Save Test Data", variable=self.save\_test\_data\_var, command=self.show\_test\_data\_ratio)
 save\_test\_data\_checkbutton.grid(row=1, column=0, padx=5, pady=5, sticky='w')
 
 # create the test data ratio label and entry field
 self.test\_data\_ratio\_label = ttk.Label(frame, text="Test DataRatio (0-1):",state="disabled")
 #self.test\_data\_ratio\_label.grid(row=2, column=0, padx=5, pady=5, sticky='w')
 self.test\_data\_ratio\_entry = ttk.Entry(frame, state="disabled")
 #self.test\_data\_ratio\_entry.grid(row=2, column=1, padx=5, pady=5, sticky='w')
 
 # create the generate models button
 generate\_models\_button = ttk.Button(frame, text="Generate Models", command=self.generate\_models\_action)
 generate\_models\_button.grid(row=3, column=0, padx=5, pady=5, sticky='ew')
 
 # hide the test data ratio widgets by default
 #self.hide\_test\_data\_ratio()
 
 def show\_test\_data\_ratio(self):
 if self.save\_test\_data\_var.get():
 self.test\_data\_ratio\_entry.grid(row=2, column=1, padx=5, pady=5, sticky='w')
 self.test\_data\_ratio\_entry.config(state="normal")
 self.test\_data\_ratio\_label.grid(row=2, column=0, padx=5, pady=5, sticky='w')
 self.test\_data\_ratio\_label.config(state="normal")
 else:
 self.test\_data\_ratio\_entry.delete(0, "end")
 self.test\_data\_ratio\_entry.grid\_remove()
 self.test\_data\_ratio\_label.grid\_remove()
 
 def hide\_test\_data\_ratio(self):
 self.test\_data\_ratio\_label.grid\_remove()
 self.test\_data\_ratio\_entry.grid\_remove()
 
 def generate\_models\_action(self):
 # get the user input
 preprocess\_data = self.preprocess\_data\_var.get()
 save\_test\_data = self.save\_test\_data\_var.get()
 test\_data\_ratio = self.test\_data\_ratio\_entry.get()
 
 
 # do something with the input
 self.text\_widget.config(state="normal")
 self.text\_widget.insert("end", f"Generate Models button clicked with preprocess\_data={preprocess\_data}, save\_test\_data={save\_test\_data}, test\_data\_ratio={test\_data\_ratio}\n")
 self.text\_widget.config(state="disabled")
 
 # close the new window
 self.prompt\_window.destroy()
 
 def predict\_data(self):
 self.text\_widget.config(state="normal")
 self.text\_widget.insert("end", "Predict Data button clicked\n")
 self.text\_widget.config(state="disabled")
 
 def model\_validation(self):
 self.text\_widget.config(state="normal")
 self.text\_widget.insert("end", "Model Validation button clicked\n")
 self.text\_widget.config(state="disabled")
 

root = ThemedTk(theme='adapta')
app = App(root)
root.mainloop()
다음은 메인\_GUI 모듈입니다:tkinter를 tk로 임포트tkinter에서 ttk를 가져옵니다.ttkthemes에서 ThemedTk를 가져옵니다.load\_preprocess를 lp로 가져옵니다.시각화를 vi로 가져옵니다.클래스 App: def \_\_init\_\_(self, master): self.master = master master.title("GUI 애플리케이션")  # 최소 창 크기 설정 master.minsize(width=400, height=300)  # 텍스트 위젯을 위한 프레임 생성 text\_frame = ttk.Frame(마스터, 패딩=10) text\_frame.pack(expand=True, fill='both')  # 텍스트 위젯을 생성하고 편집을 비활성화합니다. self.text\_widget = tk.Text(text\_frame, wrap='word', state='disabled') self.text\_widget.pack(expand=True, fill='both')  # 버튼에 대한 프레임 생성 button\_frame = ttk.Frame(마스터, 패딩=10) button\_frame.pack(side='bottom', fill='x')  # 버튼 생성 load\_data\_button = ttk.Button(button\_frame, text="데이터 로드", command=self.load\_data) data\_analysis\_button = ttk.Button(button\_frame, text="데이터 분석", command=self.data\_analysis) generate\_models\_button = ttk.Button(버튼\_프레임, 텍스트="모델 생성", 명령=self.generate\_models) predict\_data\_button = ttk.Button(button\_frame, text="데이터 예측", command=self.predict\_data) model\_validation\_button = ttk.Button(button\_frame, text="모델 유효성 검사", command=self.model\_validation) Exit\_button=ttk.Button(button\_frame, text="Exit", command=self.master.destroy)  # 버튼 그리드 load\_data\_button.grid(row=0, column=0, padx=5, pady=5, sticky='ew') data\_analysis\_button.grid(row=0, column=1, padx=5, pady=5, sticky='ew') generate\_models\_button.grid(row=0, column=2, padx=5, pady=5, sticky='ew') predict\_data\_button.grid(row=1, column=0, padx=5, pady=5, sticky='ew') model\_validation\_button.grid(row=1, column=1, padx=5, pady=5, sticky='ew') Exit\_button.grid(row=1, column=2, padx=5, pady=5, sticky='ew')  def load\_data(self): lp.load\_data() self.text\_widget.config(state="normal") self.text\_widget.insert("end", "데이터 로드 버튼 클릭\n") self.text\_widget.config(state="disabled")  def data\_analysis(self): visual\_window = tk.Toplevel(self.master) visual\_window.title("모델 생성") visual\_window.geometry('600x400') graphs=vi.create\_graphs(lp.df) # 그래프 유형을 선택하기 위한 드롭다운 메뉴 만들기 graph\_type\_var = tk.StringVar(visual\_window) graph\_type\_var.set("plot\_1") # 초기값을 설정합니다. graph\_type\_options = ["plot\_1","plot\_2","plot\_3","plot\_4","plot\_5","plot\_6"] # 사용 가능한 옵션 graph\_type\_dropdown = tk.OptionMenu(visual\_window, graph\_type\_var, \*graph\_type\_options) 그래프\_type\_dropdown.pack() vi.visualize(visual\_window,graph\_type\_var,graphs)  # 텍스트 위젯이 메시지를 표시하도록 활성화 self.text\_widget.config(state="normal") self.text\_widget.insert("end", "데이터 분석 버튼 클릭\n") self.text\_widget.config(state="disabled")  def generate\_models(self): # 새 창을 만듭니다. prompt\_window = tk.Toplevel(self.master) prompt\_window.title("모델 생성") prompt\_window.geometry('250x250') self.prompt\_window=프롬프트\_윈도우 # 위젯을 위한 프레임 생성 frame = ttk.Frame(prompt\_window, padding=10) frame.pack(expand=True, fill='both') prompt\_window.바인드('<>', 람다 이벤트:prompt\_window.destroy)  # 전처리 데이터 확인 버튼 만들기 self.preprocess\_data\_var = tk.BooleanVar() preprocess\_data\_checkbutton = ttk.Checkbutton(프레임, 텍스트="데이터 전처리", 변수=self.preprocess\_data\_var) preprocess\_data\_checkbutton.grid(행=0, 열=0, padx=5, pady=5, sticky='w')  # 테스트 데이터 저장 체크 버튼 생성 self.save\_test\_data\_var = tk.BooleanVar() save\_test\_data\_checkbutton = ttk.Checkbutton(프레임, 텍스트="테스트 데이터 분할 및 저장", 변수=self.save\_test\_data\_var, 명령=self.show\_test\_data\_ratio) save\_test\_data\_checkbutton.grid(row=1, column=0, padx=5, pady=5, sticky='w')  # 테스트 데이터 비율 라벨 및 입력 필드 생성 self.test\_data\_ratio\_label = ttk.Label(frame, text="테스트 데이터비율(0-1):",state="disabled") #self.test\_data\_ratio\_label.grid(row=2, column=0, padx=5, pady=5, sticky='w') self.test\_data\_ratio\_entry = ttk.Entry(frame, state="disabled") #self.test\_data\_ratio\_entry.grid(row=2, column=1, padx=5, pady=5, sticky='w')  # 모델 생성 버튼 생성 generate\_models\_button = ttk.Button(프레임, 텍스트="모델 생성", 명령=self.generate\_models\_action) generate\_models\_button.grid(row=3, column=0, padx=5, pady=5, sticky='ew')  # 기본적으로 테스트 데이터 비율 위젯을 숨깁니다. #self.hide\_test\_data\_ratio()  def show\_test\_data\_ratio(self): if self.save\_test\_data\_var.get(): self.test\_data\_ratio\_entry.grid(row=2, column=1, padx=5, pady=5, sticky='w') self.test\_data\_ratio\_entry.config(state="normal") self.test\_data\_ratio\_label.grid(row=2, column=0, padx=5, pady=5, sticky='w') self.test\_data\_ratio\_label.config(state="normal") else: self.test\_data\_ratio\_entry.delete(0, "end") self.test\_da