I have a text file /etc/default/foo which contains one line:
FOO=\"/path/to/foo\"
In my python script, I need to reference the
You could use execfile:
execfile("/etc/default/foo")
But please be aware that this will evaluate the contents of the file as is into your program source. It is potential security hazard unless you can fully trust the source.
It also means that the file needs to be valid python syntax (your given example file is).