title: more pythonic way to format a JSON string from a list of tuples
body: <p>Currently I'm doing this:</p>
  
  <pre><code>def getJSONString(lst):
      join = ""
      rs = "{"
      for i in lst:
          rs += join + '"' + str(i[0]) + '":"' + str(i[1]) + '"'
          join = ","
      return rs + "}"
  </code></pre>
  
  <p>which I call like:</p>
  
  <pre><code>rs = getJSONString([("name", "value"), ("name2", "value2")])
  </code></pre>
  
  <p>It doesn't need to be nested (it's only ever going to be a simple list of name value pairs). But I am open to calling the function differently. It all seems a bit cludgy, is there a more elegant way? This needs to run under 2.x.</p>
  
  <p>Note that this is not a duplicate of: <a href="https://stackoverflow.com/questions/3292643/python-convert-list-of-tuples-to-string">Python - convert list of tuples to string</a> (unless that answer can be modified to create a JSON string as output).</p>
  
  <p>edit: would it be better to pass the name value pairs as a dictionary?</p>