How to instantly destory a frame after a certain program is run
<p>This code is used to display 2 buttons, which are both linked to definitions which launch other sections of code, and then close the windows. I need to be able to close the widget after the button has been clicked</p>

<pre><code>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
</code></pre>

<h1>this is all to display buttons</h1>

<pre><code>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()
</code></pre>

<p>This really should be a comment not an answer but I don't have enough reputation for that yet.
Is this what you're looking for?
<a href="http://stackoverflow.com/questions/8009176/function-to-close-the-window-in-tkinter">Function to close the window in Tkinter</a></p>

python tkinter