Referring on this question, I have a similar -but not the same- problem..
On my way, I\'ll have some text file, structured like:
var_a: \'home\'
var_
hbn's answer won't work out of the box if the file to load is in a subdirectory or is named with dashes.
In such a case you may consider this alternative :
exec open(myconfig.py).read()
Or the simpler but deprecated in python3 :
execfile(myconfig.py)
I guess Stephan202's warning applies to both options, though, and maybe the loop on lines is safer.