title: Get the value of variables in dir(class)
body: <p>I'm writing a class in python that groups a bunch of similar variables together and then assembles them into a string. I'm hoping to avoid having to manually type out each variable in the generateString method, so I want to use something like: </p>
  
  <pre><code>for variable in dir(class):
      if variable[:1] == '_':
          recordString += variable
  </code></pre>
  
  <p>But currently it just returns a string that has all of the variable names. Is there a way to get at the value of the variable? </p>