此代码用于显示2个按钮,这两个按钮都链接到启动其他代码段的定义,然后关闭窗口。我需要能够在单击按钮后关闭窗口小部件
from tkinter import *
import tkinter
import sys
root = tkinter.Tk()
def cs_age():
print("to be completed")
def cs_male():
print('type code here to add strength and athleticism to attributes')
#I need code here to destroy the window that popped up
cs_age()
def cs_female():
print('type code here')
# I need code here to destroy the window that popped up
cs_age()
def close_window()
#put code here to universally close all popped up widgets
frame = Frame(root)
frame.pack()
bottomframe = Frame(root)
bottomframe.pack (side = BOTTOM)
cs_gendermale_button = tkinter.Button(frame, text=("Male"), fg='blue', command = cs_male)
cs_gendermale_button.pack( side = LEFT )
cs_genderfemale_button = tkinter.Button(frame, text=("Female"), fg='red', command = cs_female)
cs_genderfemale_button.pack( side = LEFT )
root.mainloop()