擅长:python、mysql、java
<p>可以从参数列表中获取填充值:</p>
<pre><code>print '%*s : %*s' % (20, "Python", 20, "Very Good")
</code></pre>
<p>甚至可以动态插入填充值:</p>
<pre><code>width = 20
args = ("Python", "Very Good")
padded_args = zip([width] * len(args), args)
# Flatten the padded argument list.
print "%*s : %*s" % tuple([item for list in padded_args for item in list])
</code></pre>