1 |
On 07/31/2010 11:10 PM, Arfrever Frehtes Taifersar Arahesis wrote: |
2 |
>> |
3 |
>> If the variable is set but not exported then it is local to the shell |
4 |
>> env. When bash goes to exec() python the local shell variables are |
5 |
>> not in the env; so os.environ() will not contain them. |
6 |
>> |
7 |
>> antarus@kyoto ~ $ foo=BAR |
8 |
>> antarus@kyoto ~ $ echo $foo |
9 |
>> BAR |
10 |
>> antarus@kyoto ~ $ python -c 'import os; print os.environ.get("foo")' |
11 |
>> None |
12 |
>> antarus@kyoto ~ $ export foo |
13 |
>> antarus@kyoto ~ $ python -c 'import os; print os.environ.get("foo")' |
14 |
>> BAR |
15 |
> |
16 |
> I want only variables exported to Python processes. |
17 |
> |
18 |
|
19 |
export -p |
20 |
|
21 |
Petteri |