If I declare an environment variable like:
$ export simple_variable="Test"
$ echo $simple_variable
Test
I can retrieve it in python with:
>>> import os
>>> var = os.environ['simple_variable']
>>> print(var)
'Test'
But if I declare an array environment variable like:
$ export array_variable=(one two three)
$ echo ${array_variable[*]}
one two three
The same python scrit will fail:
>>> import os
>>> os.environ['array_variable']
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/lib/python3.5/os.py", line 725, in __getitem__
raise KeyError(key) from None
KeyError: 'array_variable'
Why? How do I retrieve this array environment variable from my python script?