title: Python: NameError: global name 'x' is not defined
body: <p>In my <code>main()</code> function I open a config file:</p>
  
  <pre><code>cfg = {}
  execfile("config.conf", cfg)
  </code></pre>
  
  <p>config.conf looks like this:</p>
  
  <pre><code>x = 10
  </code></pre>
  
  <p>Later on, I use <code>cfg[x]</code>, which gives me <code>NameError: global name 'x' is not defined</code>.
  I took the example from <a href="https://stackoverflow.com/a/8226090/2789162">here</a>, how I use it, looks correctly to me.</p>
  
  <p>Why do I get that error?</p>