python string formating
<p>hi:
  i want to execute a git command , in shell it is as bellow:</p>

<pre><code>$ git log v2.6.38..v2.6.38-rc8 --pretty=format:%s%n%n
</code></pre>

<p>the --pretty=format:%s%n%n is to say only show the commit subject message ,and every message is split by two new line.</p>

<p>now , i want to execute in python script ,and input tag name as parameter.</p>

<p>i want do like this :</p>

<pre><code>git_cmd = "git log %(old_tag)s..%(new_tag)s --pretty=format:'%s%n%n'"
git_cmd = git_cmd % {'old_tag'='v2.6.38','new_tag'='v2.6.38-rc8'}
subprocess.Popen(shlex.split(git_cmd))
</code></pre>

<p>bug it go wrong, because %s%n%n is now interpret as a string format.</p>

<p>how can i solve it ?</p>

<p>thanks .</p>
