title: Calling Function in Python Spyder for a UI
body: <blockquote>
    <p>My code will accept values from a User Interface that will then calculate the Density, However when I try and call my function "Properties" It tells me that Pressure2 is undefined. Sorry if my formatting is bad this is my first post.</p>
  </blockquote>
  
  <pre><code>`def variables(self): #This Function gets the initial conditions from the UI
      pressure1=self.ui.pressure1.value
      pressure2=self.ui.pressure2.value
      temp1=self.ui.temp1.value
      temp2=self.ui.temp2.value
      `
  
  def properties(self): #This Function pulls values from array, when user picks the gas. 
      if self.ui.gas_2.findText('Oxygen'):
          rc=elementsMap['Oxygen'][1]
          gamma=elementsMap['Oxygen'][0]
      elif self.ui.gas_2.findText('Helium'):
           rc=elementsMap['Helium'][1]
           gamma=elementsMap['Helium'][0]
      elif self.ui.gas_2.findText('Hydrogen'):
           rc=elementsMap['Hydrogen'][1]
           gamma=elementsMap['Hydrogen'][0]
      def instanous(self): # This function calculates the instanous density.  
  
  
      rho2=self.variables(pressure2)/(self.properties(rc)*self.variables(temp2))
       NameError: name 'pressure2' is not defined  
  </code></pre>
  
  <p>`</p>