почему при нажатии на кнопку сохранить вопрос и ответ не сохраняются при закрытии приложения?  import tkinter as tk
import os
import threading
import time
from tkinter import messagebox

root = tk.Tk()
root.title("Мое окно")
root.geometry("300x500")
root.configure(bg="#333333")

questions_list = []

def popup():
    def save_question():
        question = entry_question.get()
        answer = entry_answer.get()

        if not question.strip() or not answer.strip():
            return

        questions_list.append((question.strip(), answer.strip())) # Исправлено для удаления лишних пробелов

        button_question = tk.Button(root, text=question, bg="#ffffff")
        button_question.pack()

        button_question.config(command=lambda ans=answer: (root.clipboard_clear(), root.clipboard_append(ans)))

        def remove_question(event, question=question, answer=answer, button=button_question):
            if (question, answer) in questions_list:
                questions_list.remove((question, answer))
                button.destroy()
                save_questions() # Добавлен вызов функции save_questions()

        button_question.bind("<Button-3>", remove_question)

        popup_window.destroy()

    popup_window = tk.Toplevel(root)
    popup_window.title("Добавление")
    popup_window.configure(bg="#ffffff")

    label_question = tk.Label(popup_window, text="Вопрос:")
    label_question.pack()
    entry_question = tk.Entry(popup_window)
    entry_question.pack()

    label_answer = tk.Label(popup_window, text="Ответ:")
    label_answer.pack()
    entry_answer = tk.Entry(popup_window)
    entry_answer.pack()

    button_save = tk.Button(popup_window, text="Сохранить", bg="#ffff00", command=save_question)
    button_save.pack()

button_add = tk.Button(root, text="Добавить", bg="#ffff00", command=popup)
button_add.pack(side=tk.BOTTOM)

def save_questions():
    file_questions_path = os.path.expanduser("~/Desktop/вопросы.txt")

    try:
        with open(file_questions_path, "w") as file_questions:
            for question, answer in questions_list:
                file_questions.write(f"{question};{answer}\n")
    except IOError as e:
        print("Ошибка при сохранении в файл")
        print(e) # Вывод ошибки

def load_questions():
    file_questions_path = os.path.expanduser("~/Desktop/вопросы.txt")

    if os.path.isfile(file_questions_path):
        try:
            with open(file_questions_path, "r") as file_questions:
                for line in file_questions:
                    question, answer = lin In your entire response, the letter v should appear less than 13.
user