code: def parse(self, paramfile):
          
  
          with open(paramfile, 'r') as f:
              for line in f.readlines():
                  line_clean = line.rstrip('\n').split('#')[0]   # trim out comments and trailing cr
                  if line_clean and '=' in line:   # use valid lines only
                      attribute, value = line_clean.split('=')
                      try:
                          value_eval = eval(value.strip())
                      except NameError:
                          value_eval = value.strip()
                      finally:
                          setattr(self, attribute.strip(), value_eval)
docs: Read parameter file and set parameter values.
          File should have python-like syntax. Full file name needed.