擅长:python、mysql、java
<p>您应该看看python的<a href="http://docs.python.org/library/string.html#format-string-syntax">format</a>方法。然后可以定义如下格式字符串:</p>
<pre><code>>>> s = '{0} BLAH {1} BLAH BLAH {2} BLAH BLAH BLAH'
>>> x = ['1', '2', '3']
>>> print s.format(*x)
'1 BLAH 2 BLAH BLAH 3 BLAH BLAH BLAH'
</code></pre>