OS: Mac OSX 10.14 Python 2.7
I have a python script which looks like below:
#! /usr/bin/python
import os
os.system('./binaryfileproducesenv_variables > ./env_variables_file')
os.system('chmod 744 ./env_variables_file')
os.system('./env_variables_file')
os.system('python anotherpythonscript.py')
The env_variables_file looks like this:
passwordA='abcd';
passwordB='1234';
export passwordA passwordB
The anotherpythonscript.py will only work properly if the environment variables above are set properly. When i run it via the main python script it does not define the variables. Although, if i run the ./env_variables_file directly from the command line it will set the environment variables. Any suggestions how to run this through the Python script and have it set the environment variables.