title: Is there a way to assign variables in __init__ without having them run immediately?
body: <p>So I was trying to write a program that converts various metric units to other units. (i.e. Cm to Mm) My Professor was adamant about not using <code>global</code>s and having all of our code be in either a function or a class. With the code as shown below, it gives me a:</p>
  
  <pre><code>ValueError  (*line 18, in __init__ self.intNtry = int(self.ntryAnswer) ValueError: invalid literal for int() with base 10: ''*)
  </code></pre>
  
  <p>Is there any way to have the variables not activate as soon as the program starts? I'm new to programming, please don't bully me</p>
  
  <pre><code>class Converter(Frame):
  
      def __init__(self, parent):
          Frame.__init__(self, parent)
  
          self.txt = tk.Text(self, height=1, width=45)
          self.txt1 = tk.Text(self, height=1, width=45)
          self.txt2 = tk.Text(self, height=1, width=45)
          self.txt3 = tk.Text(self, height=3, width=45)
  
          self.unit1 = tk.Entry(self)
          self.unit2 = tk.Entry(self)
          self.num1 = tk.Entry(self)
  
          self.btn = tk.Button(self, text="Calculate", padx=15, pady=15, command=self.buttonClick)
  
          **self.ntryAnswer = self.num1.get()
          self.intNtry = int(self.ntryAnswer)**
  
          self.initWindow()
  
      def buttonClick(self):
          if self.unit1 == "cm" and self.unit2 == "m":
              ans1 = float(self.intNtry) / 100
              print(ans1)
  </code></pre>