title: Python - Remove comma of last object in a string for valid JSON
body: <p>I'm facing some difficulties while trying to figure it out, what it the optimal way to convert a string to a valid JSON, using Python.</p>
  
  <p>Basically, what I need to do is to read a string (which is already given in a JSON format) from a file, and convert it to a valid JSON. The only problem in my case, is the " , " after the last object: </p>
  
  <pre><code>    {
          "InputTable" : 
          [
              {
                  "ServerName":"serverOne",
                  "To":"userOne", 
                  "CC":"", 
                  "TemplateName":"LinuxTemplate" 
              },
              {
                  "ServerName":"serverTwo",
                  "To":"userTwo", 
                  "CC":"userFive", 
                  "TemplateName":"LinuxTemplateWithCC" 
  
              }, &lt;&lt; get rid of this comma
  
          ],
          "Params": 
          [   
  
              {"Col_0":"Server","Col_1":"User","Col_2":"Action"}
          ]
      }
  </code></pre>
  
  <p>This is how I read the file:</p>
  
  <pre><code>with open('/nfs/somePath/LinuxInput.JSON') as json_file:  
          try:
              jsonFormatInputTable = json.load(json_file)
          except:
              print ("Couldn't read JSON file, cancled operation.")
              return
  </code></pre>
  
  <p>Loading the JSON file fails because the JSON is not valid.
  Do you have any suggestion, first how to get rid of that last comma, and second how to validate the string and make sure it is in the correct format?</p>