title: Add character and remove the last comma in a JSON file
body: <p>I am trying to create a JSON file through a CSV. Below code creates the data however not quite where I want it to be. I have some experience in python. From my understanding the JSON file should be written like this [{},{},...,{}].</p>
  
  <p>How do I?:</p>
  
  <ol>
  <li><p>I am able to insert the ',', however how do I remove the last ','?</p></li>
  <li><p>How do I insert '[' at the very beginning and ']' at the very end? I tried inserting it into outputfile.write('['...etc), it shows up too many places. </p></li>
  <li><p>Not include header on the first line of json file.</p></li>
  </ol>
  
  <p>Names.csv: </p>
  
  <pre class="lang-none prettyprint-override"><code>id,team_name,team_members
  123,Biology,"Ali Smith, Jon Doe"
  234,Math,Jane Smith 
  345,Statistics ,"Matt P, Albert Shaw"
  456,Chemistry,"Andrew M, Matt Shaw, Ali Smith"
  678,Physics,"Joe Doe, Jane Smith, Ali Smith "
  </code></pre>
  
  <p>Code: </p>
  
  <pre><code>import csv
  import json
  import os
  
  with open('names.csv', 'r') as infile, open('names1.json','w') as outfile:
      for line in infile:
           row = dict()
           # print(row)
           id, team_name, *team_members = line.split(',')
           row["id"] = id;
           row["team_name"] = team_name;
           row["team_members"] = team_members
           json.dump(row,outfile)
           outfile.write("," + "\n" )
  </code></pre>
  
  <p>Output so far: </p>
  
  <pre class="lang-none prettyprint-override"><code>{"id": "id", "team_name": "team_name", "team_members": ["team_members\n"]},
  {"id": "123", "team_name": "Biology", "team_members": ["\"Ali Smith", " Jon Doe\"\n"]},
  {"id": "234", "team_name": "Math", "team_members": ["Jane Smith \n"]},
  {"id": "345", "team_name": "Statistics ", "team_members": ["\"Matt P", " Albert Shaw\"\n"]},
  {"id": "456", "team_name": "Chemistry", "team_members": ["\"Andrew M", " Matt Shaw", " Ali Smith\"\n"]},
  {"id": "678", "team_name": "Physics", "team_members": ["\"Joe Doe", " Jane Smith", " Ali Smith \""]},
  </code></pre>