擅长:python、mysql、java
<p>使用<a href="https://docs.python.org/3/library/string.html#format-string-syntax" rel="noreferrer">^{<cd1>}</a>方法。在</p>
<pre><code>template = "https://stackoverflow.com/users/{0}/meskerem"
# Lots of stuff happens here
url = template.format("7833397")
</code></pre>
<p><code>format</code>方法支持它自己的小型语言,根据您的用例,您可能会发现命名模板的各个部分更加直观:</p>
^{pr2}$