I need to make an export like this in Python :
# export MY_DATA=\"my_export\"
I\'ve tried to do :
# -*- python-mode -*-
# -
eval `python -c 'import sysconfig;print("python_include_path={0}".format(sysconfig.get_path("include")))'`
echo $python_include_path # prints /home//anaconda3/include/python3.6m" in my case
python -c 'import sysconfig;print("python_include_path={0}".format(sysconfig.get_path("include")))'
It's launching a python script that
eval `python -c 'import sysconfig;print("python_include_path={0}".format(sysconfig.get_path("include")))'`
It's executing in the current bash instance the output from the python script. In my case, its executing:
python_include_path=/home//anaconda3/include/python3.6m
In other words, it's setting the environment variable "python_include_path" with that path for this shell instance.
Inspired by: http://blog.tintoy.io/2017/06/exporting-environment-variables-from-python-to-bash/