title: Making a F > Celsius converter with gui (tkinter)
body: <p>im trying to build an easy GUI with Tkinter and the function should be to convert from Fahrenheit to Celsius. I'm really trying to find out whats wrong down under but I keep getting a fault at "could not convert string to float" at line 31.</p>
  
  <pre><code>  File "test.py", line 31, in count
      fahrenheit = float(inputEntry.get()) # Hämtar input angivet av användaren.
  ValueError: could not convert string to float: 
  </code></pre>
  
  <p>Any ideas?</p>
  
  <p>Here is my code so far:</p>
  
  <pre><code>#- coding: UTF-8 -*-
  
  import Tkinter
  import tkMessageBox
  
  main_window = Tkinter.Tk()
  top_frame = Tkinter.Frame(main_window) #i parantes, skriver var framen ska vara
  bottom_frame = Tkinter.Frame(main_window) #i parantes, dvs bottom_frame ska va inne i main_window
  inputLabel = Tkinter.Label(main_window, text='Skriv antal grader =&gt;', font=('helvetica', 14))
  inputEntry = Tkinter.Entry(main_window, width = 5, bg='white', font=('helvetica', 14))
  infoLabel = Tkinter.Label(main_window, height = 5, width=40, text='Välkommen till Temperaturomvandlaren!\n' \
                                                              'Nedan kan du omvandla \nFahrenheit till Celsius.', font=('helvetica', 14), bg='#00CC33', fg='white')
  
  def main():
      setupWindow()
      count()
      Tkinter.mainloop()
  
  def setupWindow():
      main_window.title('Temperaturkonverteraren')
      main_window.geometry('380x300+500+250')
      infoLabel = Tkinter.Label(top_frame, text="Här berättas värdet")
      Tkinter.Button(main_window, width = 8, text = "Konvertera", font=('helvetica', 10), bg = "grey",command = count).grid(row=3, column=6, pady=12)
      top_frame.pack()
      bottom_frame.pack()
      infoLabel.pack()
      inputEntry.pack()
  
  
  def count():
      fahrenheit = float(inputEntry.get()) # Hämtar input angivet av användaren.
      celsius = (fahrenheit - 32) * 5 / 9
      if celsius &gt; 0: # Metod för hantering av färg och värden.
          infoLabel.configure(bg='#CC0000', text='Det blir %.2f grader Celsius.' % (celsius,))
      elif celsius  &lt; 0:
          infoLabel.configure(bg='#3366CC', text='Det blir %.2f grader Celsius.' % (celsius,))
      else:
          infoLabel.configure(bg='#00CC33', text='Det blir %.2f grader Celsius.' % (celsius,))
  
  
  if __name__ == '__main__': 
      main() 
  </code></pre>