title: Merge two json files containing array of objects in python
body: <p>I'm trying to merge two json files each of them contain an array of objects, here is an example of how the data looks line in each file: </p>
  
  <p>data in file 1: </p>
  
  <pre><code>[{"tag": "MODL", "entity": "QX50"}, {"tag": "MODL", "entity": "QX60"}, {"tag": "MODL", "entity": "QX70"}]
  </code></pre>
  
  <p>data in file 2: </p>
  
  <pre><code>[{"tag": "MANF","entity": "لكزس"},{"tag": "MANF","entity": "جيب"},{"tag": "MANF","entity": "هونداي"}]
  </code></pre>
  
  <p>so I tried to merge them by this code: </p>
  
  <pre><code>import json
  
  f1data = f2data = "" 
  
  with open('merged_file_models_arabic.json') as f1: 
    f1data = f1.read() 
  with open('MANF_arabic.json') as f2: 
    f2data = f2.read() 
  
  f1data += "\n"
  f1data += f2data
  with open ('merged_MANF_MODL.json', 'a') as f3: 
    f3.write(f1data)
  </code></pre>
  
  <p>but the result in 'merged_MANF_MODL.json' file becomes two arrays, and this is not what I want, I want the two arrays in each file merged into one array in 'merged_MANF_MODL.json' file. </p>
  
  <p>Expected result: </p>
  
  <pre><code>[{"tag": "MODL", "entity": "QX50"}, {"tag": "MODL", "entity": "QX60"}, {"tag": "MODL", "entity": "QX70"}, {"tag": "MANF","entity": "لكزس"},{"tag": "MANF","entity": "جيب"},{"tag": "MANF","entity": "هونداي"}]
  </code></pre>