title: Python3: string to variable
body: <p>I've looked everywhere for this but haven't found a suitable answer yet and I don't want to use a dictionary.</p>
  
  <p>How can I convert a string to a variable name? For example I have this call:</p>
  
  <pre><code>object.variable
  </code></pre>
  
  <p>This <code>variable</code> is defined in the <code>object</code>. However I have a LOT of variables (for a reason) and more to come. It seems stupid to do this:</p>
  
  <pre><code>s = 'variable'
  if s == 'variable': object.variable
  elif s == 'variable2: object.variable2
  etc....
  </code></pre>
  
  <p>So is there a way to convert a string to a variable name?</p>