New submission from Francis Greaves:
I am running an up to date Gentoo Linux x86_64. using Python 2.7
I have an environment variable defined, so from the command line 'echo
$XRIT_DECOMPRESS_PATH' gives '/usr/local/bin/xRITDecompress'
however, in a Python script, &
Francis Greaves added the comment:
I have the environment variable in my .bashrc file.
Interestingly if I do 'os.environ.get("PATH")' it returns the correct value for
$PATH. This is also defined in my .bashrc file, so it should be exported.
I have exported it manually from t
Francis Greaves added the comment:
Sorry my error
I should have said
cmd = os.environ.get('XRIT_DECOMPRESS_PATH')' gives 'None' as the output
--
___
Python tracker
<http:
Francis Greaves added the comment:
erykson's example works perfectly.
I have a script as follows
#!/bin/python
#
import os
cmd = os.environ.get('XRIT_DECOMPRESS_PATH')
print cmd
resulting in 'None'
and if I substitute this line
cmd = os.environ.get('PATH')
Francis Greaves added the comment:
OK, David, so what have I done wrong to not export it correctly?
in my .bashrc I have this
export XRIT_DECOMPRESS_PATH="/usr/local/bin/xRITDecompress"
so I would expect it to work.
Can you please clarify?
M
Francis Greaves added the comment:
Well since posting the last item it is now working correctly
Thank you for your help
--
___
Python tracker
<http://bugs.python.org/issue24