title: How to append in a json file in Python?
body: <p>I have the a json file whose contents is <code>{"67790": {"1": {"kwh": 319.4}}}</code>. Now I create a dictionary <code>a_dict</code> which I need to append it into the json file. I tried the following but was not able to do it correctly. Where I'm going wrong?</p>
  
  <pre><code>with open(DATA_FILENAME, 'a') as f:
     json_obj = json.dump(a_dict, json.load(f)
     f.write(json_obj)
     f.close()
  </code></pre>