title: Python AttributeError
body: <p>When I type this code into a python shell it works perfectly fine but within a program it gives an error.</p>
  
  <pre><code>import os
  h = os.environ['HOME']
  </code></pre>
  
  <p>within a script it gives this error:</p>
  
  <pre><code>AttributeError: 'str' object has no attribute 'environ'
  </code></pre>
  
  <p>Why is this happening and is there any way I can fix it? </p>
  
  <p>(I'm kinda just learning python so I dont know much. Google didn't help)</p>