title: Python get filename.variable
body: <p>I have some variables stored in a separate file. At the top of my script, I say &quot;import variables&quot; to import my variables file. This file has a lot of variables in it. I need to come up with the name for the variable I'm looking for by something that gets decided earlier in the script.
  Something in my variables file could look like this:</p>
  <pre><code>x = 1
  y = 2
  z = 3
  </code></pre>
  <p>In my main script, I have something like this:</p>
  <pre><code>if a:
      letter = x
  elif b:
      letter = y
  else:
      letter = z
  </code></pre>
  <p>It's actually much more complicated than this, but it's not feasible to simply set say, <code>number = 1, 2, or 3</code> in the if statement
  I need to be able to say something like:</p>
  <pre><code>number = variables.letter
  </code></pre>
  <p>And have it look for <code>variables.x</code> or whatever, and not literally <code>variables.number</code></p>
  <p>Is there any way to do this?</p>