title: accessing environment variable in python script when called from a shell script differs from running it in the shell directly
body: <p>I have a shell script which is calling the python script</p>
  
  <pre><code>#!/bin/bash
  
  sudo python test.py
  </code></pre>
  
  <p>test.py is accessing some environment variable </p>
  
  <pre><code>os.getenv('MYKEY')
  </code></pre>
  
  <p>I get <code>None</code> when python script is being called from shell script. However it works fine if <code>test.py</code> is executed directly from the shell.</p>
  
  <p>Please help</p>