How do I dump and load multiple python objects into and from a json file?
<p>I want to store several variables in a json file.</p>

<p>I know I can dump multiple variable like this-</p>

<pre><code>import json
with open('data.json', 'w') as fp:
    json.dump(p_id,fp, sort_keys = True, indent = 4)
    json.dump(word_list, fp, sort_keys = True, indent = 4)
    .
    .
    .
</code></pre>

<p>But these variables are stored without their names and trying to load them gives errors. How do I store and extract the variables I want appropriately?</p>