title: NameError: name 'click_entry' is not defined (Python)
body: <pre><code>from tkinter import *
  
  class fidgetSpinner:    
  
  
      def spin():
          status_str = float(click_entry.get())
  
      window = Tk() # Create a window
      window.title("11.2 GUI")
  
  
      mainframe = Frame(window)
      mainframe.grid(column=0, row=0, sticky=(N, W, E, S))
      mainframe.columnconfigure(0, weight=1)
      mainframe.rowconfigure(0, weight=1)
  
      click_entry = Entry(mainframe, width=20)
      click_entry.grid(column=2, row=1, sticky=(W, E))
  
      click = click_entry.get()
      status_str = StringVar()
  
      Label(mainframe, textvariable=status_str).grid(column=2, row=2, sticky=(W, E))
      Button(mainframe, text="Fidget Click!", command=spin).grid(column=2, row=3, sticky=W)
  
      Label(mainframe, text="Enter Click Count:").grid(column=1, row=1, sticky=W)
      Label(mainframe, text="status:").grid(column=1, row=2, sticky=E)
      Label(mainframe, text=click).grid(column=2, row=2, sticky=E)
  
      window.mainloop() # Create an event loop
  
  myWidgets = fidgetSpinner() # Create GUI
  
  
  myWidgets = fidgetSpinner() # Create GUI
  </code></pre>
  
  <p>When I run this program and enter some text and when I input some number into </p>
  
  <p><code>click_entry = Entry(mainframe, width=20)</code> and click <code>Fidget Click!</code></p>
  
  <p>it just says</p>
  
  <pre><code>Exception in Tkinter callback
  Traceback (most recent call last):
    File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/tkinter/__init__.py", line 1699, in __call__
      return self.func(*args)
    File "/Users/kalib/OneDrive - University of Tasmania/Programming introduction KIT001/11.2dn GUI/11.2dn GUI.py", line 7, in spin
      status_str = float(click_entry.get())
  NameError: name 'click_entry' is not defined
  </code></pre>
  
  <p>Also I didn't want to make a program about a fidget spinner that's just what we were meant to call the program.</p>