title: Calculations on user input in Entry box Python tkinter
body: <p>I just have a quick question regarding calculations from a user input via the Entry Box. I'm confused as to why the calculation isn't being performed in the "def concentration" function labelled "CCalc". I imagine the error is coming from the code being unable to get the user input, "tbschk", from the previous function. Is there something else I need to look into to figure how to do this correctly?</p>
  
  <pre><code>import tkinter as tk
  from tkinter import Label, Button, Entry
  
  #multiply total brain by 1000ul
  def tbscalc():
      Bchk=float(BNum.get())
      BCalc = (Bchk*1000)
      tbsCalc["text"]=str(BCalc)
  
  #divide concentration by total TBSul
  def concentration():
      Cchk=float(Conc.get())
      tbschk=float(tbsCalc.get())
      CCalc=(tbschk/Cchk)
      PCalc["text"]=str(CCalc)
  
  window=tk.Tk()
  window.geometry("500x500")
  
  #Using total brain to calculate TBS
  BLabel=Label(window, text="Enter number of brains")
  tbsLabel=Label(window, text="Amount of TBS needed in ul")
  tbsCalc=Label(window)
  BNum=Entry(window)
  BTBSbtn=Button(window, text="Calculate", command=tbscalc)
  
  #Using concentration to calculate total primary
  CLabel=Label(window, text="Enter primary concentration")
  PLabel=Label(window, text="This is how much primary antibody you need")
  PCalc=Label(window)
  Conc=Entry(window)
  TPbtn=Button(window, text="Calculate", command=concentration)
  
  #Locations
  BLabel.grid(row=0 ,column=0)
  BNum.grid(row=0 ,column=1)
  tbsLabel.grid(row=1 ,column=0)
  tbsCalc.grid(row=1 ,column=1)
  BTBSbtn.grid(row=2 ,column=0)
  CLabel.grid(row=3, column=0)
  Conc.grid(row=3, column=1)
  PLabel.grid(row=4, column=0)
  PCalc.grid(row=4, column=1)
  TPbtn.grid(row=5, column=0)
  
  window.mainloop()
  </code></pre>
  
  <p>I get the error message:</p>
  
  <blockquote>
    <p>Exception in Tkinter callback
        Traceback (most recent call last):
          File "C:\Users\Kevin\Anaconda3\lib\tkinter__init__.py", line 1699, in <strong>call</strong>
            return self.func(*args)
          File "C:/Users/Kevin/Desktop/Python/IHCprotocol.py", line 13, in concentration
            tbschk=float(tbsCalc.get())
        AttributeError: 'Label' object has no attribute 'get'</p>
  </blockquote>
  
  <p>The error it's referring to </p>
  
  <pre><code>class CallWrapper:
      """Internal class. Stores function to call when some user
      defined Tcl function is called e.g. after an event occurred."""
      def __init__(self, func, subst, widget):
          """Store FUNC, SUBST and WIDGET as members."""
          self.func = func
          self.subst = subst
          self.widget = widget
      def __call__(self, *args):
          """Apply first function SUBST to arguments, than FUNC."""
          try:
              if self.subst:
                  args = self.subst(*args)
              return self.func(*args)
          except SystemExit:
              raise
          except:
              self.widget._report_exception()
  </code></pre>