title: I am getting a 'str' object has no attribute 'get' error (Python) with Tkinter Entry Box
body: <p>I am currently working on a project where I will have a plethora of equations and laws from different subject areas within a calculator with GUI functionality. This project is a learning process and all help is appreciated. I am currently having trouble with the <code>Tkinter</code> Entry boxes, more specifically retrieving the values behind string variables. Every time I attempt to use <code>.get()</code> my Entry boxes return an error, <code>'str' object has no attribute 'get'</code>, which I can't figure out. I would also really appreciate if someone could help trim the fat of my code and minimize the bulk.</p>
  <p>The issue is occurring in <code>class ReactionProp()</code> in <strong>Science_Calculator.py</strong>. Thanks to all who respond!</p>
  <p>P.S. Sorry about weird formatting lol</p>
  <pre><code>from tkinter import *
  import tkinter as tk
  import math
  
  &quot;&quot;&quot;    Calculator     &quot;&quot;&quot;     
  class CalculatorGUI(tk.Tk):
     def __init__(self, *args, **kwargs):
         
         tk.Tk.__init__(self, *args, **kwargs)
         container = tk.Frame(self)
  
         container.pack(expand = True)
  
         container.grid_rowconfigure(0)
         container.grid_columnconfigure(0)
  
         self.frames = {}
  
         for F in ([ReactionProp]):
  
             frame = F(container, self)
  
             self.frames[F] = frame
  
             frame.grid(row=0, column=0, sticky=NS)
  
         self.show_frame(ReactionProp)
  
     def show_frame(self, cont):
  
         frame = self.frames[cont]
         frame.tkraise()
  
  class ReactionProp(tk.Frame):       
     def __init__(self, parent, controller):
         tk.Frame.__init__(self,parent)
         
         checkT = tk.DoubleVar(self)
         r1 = tk.StringVar(self)
         r2 = tk.StringVar(self)
         r3 = tk.StringVar(self)
         r4 = tk.StringVar(self)
         r5 = tk.StringVar(self)
         p1 = tk.StringVar(self)
         p2 = tk.StringVar(self)
         p3 = tk.StringVar(self)
         p4 = tk.StringVar(self)
         p5 = tk.StringVar(self) 
         
         &quot;&quot;&quot;    Activation Code     &quot;&quot;&quot;
         def SolveReactionProp():
             Calculate = Calculator()  #Refers to Calculator Class
             
             r1 = ''
             r2 = ''
             r3 = ''
             r4 = ''
             r5 = ''
             p1 = ''
             p2 = ''
             p3 = ''
             p4 = ''
             p5 = ''
             
             if r1.get():
                 r1 = var1.get()
             if z2.get():
                 r2 = var2.get()
             if r3.get():
                 r3 = var3.get()
             if r4.get():
                 r4 = var4.get()
             if r5.get():
                 r5 = var5.get()
             if p1.get():
                 r6 = var6.get()
             if p2.get():
                 r7 = var7.get()
             if p3.get():
                 r8 = var8.get()
             if p4.get():
                 r9 = var9.get()
             if p5.get():
                 r10 = var10.get()
                         
             Calculate.ReactionProp()
         
         Label(self, text='Thermodynamics - Reaction Properties', font='Helvetica 24 bold').grid(row=0,column=0,columnspan=4,padx=(100),pady=(0,30))
         
         Radiobutton(self,text='Temperature (K)',font='Helvetica 14',variable=checkT,value=1).grid(row=1,column=0,columnspan=2,sticky=EW,pady=(0,25))
         Radiobutton(self,text='No Temperature',font='Helvetica 14',variable=checkT,value=0).grid(row=2,column=0,columnspan=2,sticky=EW,pady=(0,25))
         tE = Entry(self,width=40)
         tE.grid(row=1,column=2,columnspan=2,pady=(35,0),sticky=W)
     
         Label(self, text='Reactants:',font='Helvetica 14').grid(row=3,column=0,columnspan=2)
         r1 = Entry(self,width=40)
         r1.grid(row=4,column=0,columnspan=2,pady=(25,0))
         r2 = Entry(self,width=40)
         r2.grid(row=5,column=0,columnspan=2,pady=(25,0))
         r3 = Entry(self,width=40)
         r3.grid(row=6,column=0,columnspan=2,pady=(25,0))
         r4 = Entry(self,width=40)
         r4.grid(row=7,column=0,columnspan=2,pady=(25,0))
         r5 = Entry(self,width=40)
         r5.grid(row=8,column=0,columnspan=2,pady=(25,0))
         
         Label(self, text='Products:',font='Helvetica 14').grid(row=3,column=2,columnspan=2)
         p1 = Entry(self,width=40)
         p1.grid(row=4,column=2,columnspan=2,pady=(25,0))
         p2 = Entry(self,width=40)
         p2.grid(row=5,column=2,columnspan=2,pady=(25,0))
         p3 = Entry(self,width=40)
         p3.grid(row=6,column=2,columnspan=2,pady=(25,0))
         p4 = Entry(self,width=40)
         p4.grid(row=7,column=2,columnspan=2,pady=(25,0))
         p5 = Entry(self,width=40)
         p5.grid(row=8,column=2,columnspan=2,pady=(25,0))
         
         Button(self, text=&quot;Solve&quot;, font ='Helvetica 12 bold', command=SolveReactionProp).grid(row=9,column=1,pady=(100,0))
         Button(self, text=&quot;Return&quot;, font='Helvetica 12 bold', command=lambda:[controller.show_frame(ThermoTab)]).grid(row=9,column=2,pady=(100,0))
  
  start  = CalculatorGUI()
  start.mainloop()      
  </code></pre>
  <p>Error Code:</p>
  <pre><code>Exception in Tkinter callback
  Traceback (most recent call last):
    File &quot;C:\Users\Heath\anaconda3\lib\tkinter\__init__.py&quot;, line 1883, in __call__
      return self.func(*args)
    File &quot;C:\Users\Heath\Documents\Science Calculator Project\untitled0.py&quot;, line 69, in SolveReactionProp
      if r1.get():
  </code></pre>