xxxxxxxxxx
import tkinter as tk
def close_window():
window.destroy()
window = tk.Tk()
# Add widgets and configure the window as needed
# Create a button to close the window
close_button = tk.Button(window, text="Close", command=close_window)
close_button.pack()
window.mainloop()