title: Call function via for loop with functons as a list of strings
body: <p>I am trying to write a PyQt5 application. All the list items in list variables are LineEdit objects of a form. On calling a reset function, I wish to set them to specific values for which I am trying to write a for loop instead of hard coding.</p>
  
  <p>However, I cant use the list items in variables as objects as they are object attributes in other file and doing </p>
  
  <pre><code>self.eval(variables[i]).setText(default_0_values[i])
  </code></pre>
  
  <p><strong>does't work</strong>, since eval is not an attribute of self.
  However, if I run </p>
  
  <pre><code>self.nGASLineEdit.setText(2)
  </code></pre>
  
  <p><strong>it works</strong>. But I <strong>cant seem to be able to automate</strong> it  and I'm stuck. Need a work around this.</p>
  
  <pre><code>from PyQt5 import QtCore,QtGui,QtWidgets,uic
  
  variables=[
  'nGASLineEdit','nDELTALineEdit','iMIPLineEdit','nDVECLineEdit','nSEEDLineEdit','eSTARTLineEdit','eTHRMLineEdit','eCUTLineEdit','nGAS1LineEdit','nGAS2LineEdit','nGAS3LineEdit','nGAS4LineEdit','nGAS5LineEdit','nGAS6LineEdit','fRAC1LineEdit','fRAC2LineEdit','fRAC3LineEdit','fRAC4LineEdit','fRAC5LineEdit','fRAC6LineEdit','tEMPLineEdit','tORRLineEdit','eFIELDLineEdit','bMAGLineEdit','bTHETALineEdit','iWRITELineEdit','iPENLineEdit','dETEFFLineEdit','eXCWGHTLineEdit','kGASLineEdit','lGASLineEdit','lCMPLineEdit','lRAYLineEdit','lPAPLineEdit','lBRMLineEdit','iECASCLineEdit'
  ]
  
  default_0_values=[
  2,100,5,1,0,1.0,1.5,2.0,
  2 ,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 
  ]
  
  class Window(QtWidgets.QMainWindow):
      def __init__(self):
          super(Window,self).__init__()
          uic.loadUi('main.ui',self)
          self.pushButton_2.clicked.connect(lambda: self.reset())
  
      def select_func(self,func_name):
          return func_name
  
      def reset(self):
          global variables
          global default_0_values
          for i in range(len(variables)):
              self.eval(variables[i]).setText(default_0_values[i])
  
  
  
  
  if __name__=='__main__':
      import sys
      app=QtWidgets.QApplication(sys.argv)
      window=Window()
      window.show()
      sys.exit(app.exec())
  </code></pre>
  
  <p><a href="https://gist.github.com/fireballpoint1/d5dfbe8311920ae3dcf65df8f71731d3" rel="nofollow noreferrer">UI file in .ui format</a></p>
  
  <p><a href="https://gist.github.com/fireballpoint1/537bb2ae878277751a37efc35b44c597" rel="nofollow noreferrer">UI file in .py format</a></p>