title: Python string interpolation using dictionary and strings
body: <p>Given:</p>
  
  <pre><code>dict = {"path": "/var/blah"}
  curr = "1.1"
  prev = "1.0"
  </code></pre>
  
  <p>What's the best/shortest way to interpolate the string to generate the following:</p>
  
  <blockquote>
    <p>path: /var/blah curr: 1.1 prev: 1.0</p>
  </blockquote>
  
  <p>I know this works:</p>
  
  <pre><code>str = "path: %(path)s curr: %(curr)s prev: %(prev)s" % {"path": dict["path"],"curr": curr, "prev": prev}
  </code></pre>
  
  <p>But I was hoping there is a shorter way, such as:</p>
  
  <pre><code>str = "path: %(path)s curr: %s prev: %s" % (dict, curr, prev)
  </code></pre>
  
  <p>My apologies if this seems like an overly pedantic question.</p>