Writing to a specific dictionary inside a json file Python
<p>I have a .json file with some information    </p>

<pre><code>{"items": [{"phone": "testp"}, {"phone": "Test2"}]}
</code></pre>

<p>I want to add another dictionary into the next available slot in the array with some more information. I have tried many ways however no of them work, has anyone got any ideas?</p>

<pre><code>dictionary["items"].append(new_dictionary)
</code></pre>

<p>You access key "items" in your dictionary, which is a list of dictionaries, to that list you simply append your new dictionary</p>

python json dictionary