Converting a shell script to python and trying to find the best way to perform the following. I need this as it contains environment variables I need read.
if [ -e "/etc/rc.platform" ];
then
. "/etc/rc.platform"
fi
I have the 'if' converted but not sure how to handle the . "/etc/rc.platform" as source is a shell command. So far I have the following
if os.path.isfile("/etc/rc.platform"):
print "exists" <just to verify the if if working>
<what goes here to replace "source /etc/rc.platform"?>
I've looked at subprocess and execfile without success.
The python script will need to access the environment variables set by rc.platform