Take the 2-minute tour ×

I'm working with SCONS and using the Substfile() to generate a new file from a template. I provide a replacement dictionary via the SUBST_DICT parameter of Substfile().

In my replacement dictionary, I've got a key "@DUMMY@" that has a value of "${SOMETHING}".

When SCONS does the replacement, @DUMMY@ is replaced with a blank. How do I get it to fill in ${SOMETHING} instead?

I've tried various escapes: "\${SOMETHING}": invalid escape sequence "\${SOMETHING}": replaces with "\${SOMETHING}"

share|improve this question
add comment

1 Answer

Just found the answer in some Python docs. Escaping the value with an extra $ resolved the problem.

So setting "@DUMMY@" equal to "$${SOMETHING}" resolved the problem.

share|improve this answer
add comment

Your Answer


