Obtain the variable in bash.

Hongyi Zhao hongyi.zhao at gmail.com
Wed Mar 23 03:12:16 EDT 2016


Hi all,

I exported a variable in my .bashrc as follows:

export MY_VAR="fdsfads"

Then I soured the .bashrc and do the testing as follows:

werner at debian-01:~$ python -c "import os; print os.environ['MY_VAR']"
fdsfads

But, when I run the same commands in pycharm and wing ide, I failed the 
obtain the value of this variable.

I'm very confused with this issue.

Any hints?

Regards
-- 
.: Hongyi Zhao [ hongyi.zhao AT gmail.com ] Free as in Freedom :.



More information about the Python-list mailing list