Converting string into valid json with Python
<p>This string is returned to my app:</p>

<pre><code>[
  {
    "object1": "here",
    "morekeys": "can also have objects as values"
  }
  {
    "object2": "here",
    "morekeys": "can also have objects as values"
  }
]
</code></pre>

<p>The string is not valid JSON. All that's missing is the comma between the two valid JSON objects.</p>

<p>What's the best method to turn this string into valid JSON with Python?</p>

<p>Edit:</p>

<p>The string is the result of calling subprocess.check_output(), like for example this:</p>

<pre><code>my_string = "[" + subprocess.check_output("command1 &amp;&amp; command2", shell=True, stderr=STDOUT) + "]"
</code></pre>

<p>Since each command outputs a valid JSON object, I am receiving invalid JSON as a result.</p>