How do I parse a templated string in Python?
<p>I'm new to Python, so I'm not sure exactly what this operation is called, hence I'm having a hard time searching for information in it.</p>

<p>Basically I'd like to have a string such as:</p>

<pre><code>"[[size]] widget that [[verb]] [[noun]]"
</code></pre>

<p>Where size, verb, and noun are each a list.</p>

<p>I'd like to interpret the string as a metalanguage, such that I can make lots of sentences out permutations from the lists. As a metalanguage, I'd also be able to make other strings that use those pre-defined lists to generate more permutations.</p>

<p>Are there any capabilities for variable substitution like this in Python? What term describes this operation if I should just Google it?</p>
