How to write a python dictionary to a json file in the following format? : <p>so I have a python dictionary in the form of {'key1':[value1, value2]},
I hope to write it to a json file in the format of:</p>

<pre><code>{
   "key1": [value1, value2],
   "key2": [value, value],
   ....
}
</code></pre>

<p>I am currently using json.dump(dictionary, file_to_write_to), and the output looks like:</p>

<pre><code>{"key1": [value1, value2], "key2": [value, value]}
</code></pre>
