title: How to set environment variables of parent shell in Python?
body: <p>I'm trying to modify the environment variables on a parent shell from within Python.  What I've attempted so far hasn't worked:</p>
  
  <pre><code>~ $ export TESTING=test
  ~ $ echo $TESTING
  test
  ~ $
  ~ $
  ~ $ python
  Python 2.7.10 (default, Jun  1 2015, 18:05:38)
  [GCC 4.9.2] on cygwin
  Type "help", "copyright", "credits" or "license" for more information.
  &gt;&gt;&gt; import os
  &gt;&gt;&gt; os.environ['TESTING']
  'test'
  &gt;&gt;&gt; os.environ['TESTING'] = 'changed'
  &gt;&gt;&gt; os.environ['TESTING']
  'changed'
  &gt;&gt;&gt; quit()
  ~ $
  ~ $
  ~ $ echo $TESTING
  test
  </code></pre>
  
  <p>That's all I've been able to come up with.  Can it be done?  How do I set environment variables of parent shell in Python?</p>