title: Set environment variable such that it can be read outside my program
body: <p>Here's my script:</p>
  
  <pre><code>try:
      os.environ['CONSOLE'] = '1'
      while True:
          ...
  except KeyboardInterrupt:
      del os.environ['CONSOLE']
  </code></pre>
  
  <p>I'm trying to set an environment variable called <code>CONSOLE</code>. While this program is running that variable should exist, once I exit out of it with Ctrl+C it should disappear.</p>
  
  <p>When I leave the program running and try printing it from my shell, however, I get:</p>
  
  <pre><code>$ echo $CONSOLE
  CONSOLE: Undefined variable.
  </code></pre>
  
  <p>I can't seem to read it from my PHP script either. Where's my variable? I thought <code>os.environ</code> should allow me to do this?</p>