title: Creating Environment Variables in Python does not seem to work
body: <p>I am writing a python script and I want this script to write some value to an environment variable which does not exist before the running of this script. The OS which I am running is Ubuntu. So ideally, after execution of the script, I should be able to display the environment variable using the echo command on the terminal. By that I mean the terminal behaviour should be as such:</p>
  
  <pre><code>&gt; echo $NEW_VAR
  environmentvarvalue
  </code></pre>
  
  <p>I want to be able to access this environment variable in a different python script as well. So the following code:</p>
  
  <pre><code>import os
  output = "The value of NEW_VAR is " + os.environ.get('NEW_VAR')
  print output
  </code></pre>
  
  <p>when run after running the initial script, should produce the following output when executed:</p>
  
  <pre><code>The value of NEW_VAR is environmentvarvalue
  </code></pre>
  
  <p>I have tried the following code in my initial script after a bit of research about this:</p>
  
  <pre><code>import os
  os.environ['NEW_VAR'] = 'environmentvarvalue'
  </code></pre>
  
  <p>but the environment variable gets saved only for the scope of the initial scrpt, and when I run the echo command on the terminal after execution of the script, the behaviour is the same as when the variable does not exist. Is there something wrong with my code? Or is there a better way of assigning an environment variable through python? I know that I can probably run the export command from the subprocess python module, but this does not seem like the right way to solve this problem.</p>