title: How to make the environment variable shared both by bash and python3 conveniently?
body: <p>I have written a environment variable in <code>/etc/bash.bashrc</code>.</p>
  
  <pre><code>MY_PASS="xxxx"
  </code></pre>
  
  <p>Call the variable in bash is simple.</p>
  
  <pre><code>echo $MY_PASS
  </code></pre>
  
  <p>You can write <code>$MY_PASS</code> in your bash script.Now how can get it with python3's os module?</p>
  
  <pre><code>import os
  os.environ['MY_PASS']
  </code></pre>
  
  <p>I got error info:</p>
  
  <pre><code>raise KeyError(key) from None
  KeyError: 'MY_PASS'
  </code></pre>
  
  <p>How to make the environment variable shared both by bash and python3 conveniently?<br>
  In order to call by bash and python3 conveniently,which file shall i write the environment variable into?</p>