title: Logical Problem in tkinter. Label won't destroy
body: <p>I have a calculator that has many featuresa and in my geometric calculator ive run into a problem and am not able to destroy a label.</p>
  <pre><code>def geometric_calc_press():
      global bool_
  
      def formula():
          global bool_, formula_entry
          if bool_:
              formula_entry = Entry(geometric_calc, width=66)
              formula_entry.grid(row=1, column=0, columnspan=1000)
              bool_ = False
  
  
          def show_searched_formula():
              global formula_entry, bool_
              try:
                  font = tkFont.Font(size=40)
                  searched_formula = formula_entry.get()
                  area_formulas = ['1/2 ⋅ g ⋅ h', 'g ⋅ h', 'a ⋅ a', 'a ⋅ b', '1/2 ⋅ (a + c) ⋅ h']
  
                  triangle_area = ['triangle', 'area of triangle', 'area of a triangle', 'triangle area',
                                   'Area of triangle',
                                   'Triangle Area', 'Area Of a Triangle', 'triangles area',
                                   'Triangles area', 'what is the area of a triangle', 'trianglearea']
                  square_area = ['square', 'area of square', 'area of a square', 'square area', 'Area of square',
                                 'Square Area', 'Area Of a Square', 'squares area',
                                 'Squares area', 'what is the area of a square', 'squarearea']
                  rectangle_area = ['rectangle', 'area of rectangle', 'area of a rectangle', 'rectangle area',
                                    'Area of rectangle',
                                    'Rectangle Area', 'Area Of a Rectangle', 'rectangles area',
                                    'Rectangle area', 'what is the area of a rectangle', 'rectanglearea']
                  paralellogram_area = ['paralellogram', 'area of paralellogram', 'area of a paralellogram',
                                        'paralellogram area', 'Area of paralellogram',
                                        'Paralellogram Area', 'Area Of a Paralellogram', 'paralellogram area',
                                        'Paralellogram area', 'what is the area of a Paralellogram', 'paralellogramarea']
                  trapezoid_area = ['trapezoid', 'area of trapezoid', 'area of a trapezoid',
                                        'trapezoid area', 'Area of trapezoid',
                                        'Trapezoid Area', 'Area Of a Trapezoid', 'trapezoid area',
                                        'Trapezoid area', 'what is the area of a Trapezoid', 'trapezoidarea']
  
  
                  if searched_formula in triangle_area:
                      formula = area_formulas[0]
                  elif searched_formula in square_area:
                      formula = area_formulas[2]
                  elif searched_formula in rectangle_area:
                      formula = area_formulas[3]
                  elif searched_formula in paralellogram_area:
                      formula = area_formulas[1]
                  elif searched_formula in trapezoid_area:
                      formula = area_formulas[4]
  
                  space = Label(geometric_calc, text='', bg='black').grid(row=4, column=0)
                  space2 = Label(geometric_calc, text='', bg='black').grid(row=5, column=0)
                  space3 = Label(geometric_calc, text='', bg='black').grid(row=6, column=0)
                  space4 = Label(geometric_calc, text='', bg='black').grid(row=7, column=0)
                  space5 = Label(geometric_calc, text='', bg='black').grid(row=8, column=0)
                  space6 = Label(geometric_calc, text='', bg='black').grid(row=9, column=0)
                  show_formula = Label(geometric_calc, text=formula, bg='black', fg='lime', font=font)
                  show_formula.grid(row=10, column=0, columnspan=1000)
  
              except UnboundLocalError:
                  pass
  
          def close():
              global bool_, formula_entry, close, search_
              bool_ = True
              formula_entry.destroy()
              close_.destroy()
              search.destroy()
              formula_finder.config(state='normal')
  
          if not bool_:
              close_ = Button(geometric_calc, text='Close', command=close, bg='black', fg='lime', highlightcolor=&quot;lime&quot;,
                              highlightbackground=&quot;lime&quot;,
                              highlightthickness=2, relief=SOLID, default='active', padx=80, pady=20)
              close_.grid(row=3, column=0)
  
              search = Button(geometric_calc, text='Search', command=show_searched_formula, bg='black', fg='lime',
                              highlightcolor=&quot;lime&quot;, highlightbackground=&quot;lime&quot;,
                              highlightthickness=2, relief=SOLID, default='active', padx=77, pady=20)
              search.grid(row=2, column=0)
              formula_finder.config(state='disabled')
  </code></pre>
  <p>I tried to do label.destroy in a not bool_ if statement but it didnt work. Suggestions??? And when i put show_formula.destroy in the close function it says show_formula is not defined.</p>