title: SyntaxError: unexpected EOF while parsing Python Calculator
body: <p>I have a calculator in Python 3 but for some reason my code doesn't work. It works fine until I press the "=" button to calculate my thing (using tkinter for the gui). Here is my code (it is quite long, sorry for that, it is just a part from my code)</p>
  
  <hr>
  
  <pre><code>from tkinter import *
  
  from tkinter.ttk import *
  
      def SMATH():
  
          #PUT TEXT IN ENTRY FUNCTION
  
          def puttext(text):
              sm_ent.insert(0,text)
              return
  
          #CLEAR THE ENTRY FUNCTION
  
          def cleartext():
              sm_ent.delete(0, END)
              return
  
          #GET THE OUTCOME FUNCTION
  
          def Coutcome():
              calc = caltext.get()
              answer = eval(calc)
              sm_ent = Entry(e_frame, textvariable=caltext, text=answer)
  
          smathW = Tk()
          smathW.title("Simple Math")
          smathW.resizable(0,0)
          smathW.wm_iconbitmap('icon.ico')
  
          def quitSmath():
              smathW.destroy()
  
          #ENTRY FRAME
          e_frame = Frame(smathW)
          e_frame.pack()
  
          #BUTTONS FRAME
  
          b_frame = Frame(smathW)
          b_frame.pack()
  
          #ENTRY
          caltext= StringVar()
          sm_ent = Entry(e_frame, textvariable=caltext)
          sm_ent.pack(fill=Y)
  
          #LABEL
  
          sm_inf = Label(smathW, text="Here is the Simple Math mode from CalfoWin")
          sm_inf.pack()
  
          #BUTTON 7
  
          sm_butt0 = Button(b_frame, text="7", command=lambda: puttext('7'))
          sm_butt0.grid(row=1, column=0)
  
          #BUTTON 8
  
          sm_butt1 = Button(b_frame, text="8", command=lambda: puttext('8'))
          sm_butt1.grid(row=1, column=1)
  
          #BUTTON 9
  
          sm_butt2 = Button(b_frame, text="9", command=lambda: puttext('9'))
          sm_butt2.grid(row=1, column=2)
  
          #BUTTON 4
  
          sm_butt3 = Button(b_frame, text="4", command=lambda: puttext('4'))
          sm_butt3.grid(row=2, column=0)
  
          #BUTTON 5
  
          sm_butt4 = Button(b_frame, text="5", command=lambda: puttext('5'))
          sm_butt4.grid(row=2, column=1)
  
          #BUTTON 6
  
          sm_butt5 = Button(b_frame, text="6", command=lambda: puttext('6'))
          sm_butt5.grid(row=2, column=2)
  
          #BUTTON 1
  
          sm_butt6 = Button(b_frame, text="1", command=lambda: puttext('1'))
          sm_butt6.grid(row=3, column=0)
  
          #BUTTON 2
  
          sm_butt7 = Button(b_frame, text="2", command=lambda: puttext('2'))
          sm_butt7.grid(row=3, column=1)
  
          #BUTTON 3
  
          sm_butt8 = Button(b_frame, text="3", command=lambda: puttext('3'))
          sm_butt8.grid(row=3, column=2)
  
          #BUTTON 0
          sm_butt9 = Button(b_frame, text="0", command=lambda: puttext('0'))
          sm_butt9.grid(row=4, column=0)
  
          #BUTTON KOMMA
  
          sm_buttKomma = Button(b_frame, text=".", command=lambda: puttext('.'))
          sm_buttKomma.grid(row=4, column=1)
  
          #BUTTON EQUALSIGN!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  
          sm_buttEsign = Button(b_frame, text="=", command=Coutcome())
          sm_buttEsign.grid(row=4, column=2)
  
          #BUTTON ADDITION
  
          sm_buttPlus = Button(b_frame, text="+", command=lambda: puttext('+'))
          sm_buttPlus.grid(row=2, column=3)
  
          #BUTTON SUBTRACKTION
  
          sm_buttMin = Button(b_frame, text="-", command=lambda: puttext('-'))
          sm_buttMin.grid(row=3, column=3)
  
          #BUTTON DIVISION
  
          sm_buttDiv = Button(b_frame, text="/", command=lambda: puttext('/'))
          sm_buttDiv.grid(row=3, column=4)
  
          #BUTTON MULTIPLICATION
  
          sm_buttMult = Button(b_frame, text='x', command=lambda: puttext('*'))
          sm_buttMult.grid(row=2, column=4)
  
          #BUTTON CLEAR
  
          sm_buttClear = Button(b_frame, text="Clear", command=lambda: cleartext())
          sm_buttClear.grid(row=1, column=3)
  
          #BUTTON QUIT
  
          sm_buttquit = Button(b_frame, text="Quit", command=lambda: quitSmath())
          sm_buttquit.grid(row=1, column=4)
  </code></pre>