How to check environment variables in python
<p>How to check all environment variables in python. I'm trying to install cx_Oracle and instant client and want to make sure all my variables are ok. </p>

<p>To elaborate further on my comment. All environment variables can be found within the <code>os.environ</code> dictionary (you'll need to <code>import os</code> first).</p>

<p>It looks like <code>TNS_ADMIN</code> is one of the environment variables used for <code>tnsnames.ora</code>, so you can check like this:</p>

<pre><code>import os

if 'TNS_ADMIN' in os.environ:
    print('TNS_ADMIN is set to {}'.format(os.environ['TNS_ADMIN']))
else:
    print('TNS_ADMIN has not been set.')
</code></pre>

python oracle11g cx-oracle