Valid JSON using Python
Question: Is this a valid JSON object?

    
    
    {"Age": "2", "Name": "Rice, Master. Eugene", "Parch": "1", "Pclass": "3", "Ticket": "382652", "PassengerId": "17", "SibSp": "4", "Embarked": "Q", "Fare": "29.125", "Survived": "0", "Cabin": "", "Sex": "male"}
    

Do I need an EOF?

I have used the following to create the file:

    
    
    import json
    import sys
    fieldnames=["PassengerId","Survived","Pclass","Name","Sex","Age","SibSp","Parch","Ticket","Fare","Cabin","Embarked"]
    csvfile=open('t1.csv','r')
    jsonfile = open('file1.json', 'w')
    reader = csv.DictReader( csvfile, fieldnames)
    for row in reader:
    #       if reader.line_num ==1:
                    #continue # Skip the first line
            json.dump(row, jsonfile)
            jsonfile.write('\n')
    print("Total No of Lines Wriiten : "+ str(reader.line_num))
    


Answer: Simple test via
[json.loads()](https://docs.python.org/3/library/json.html#json.loads):

    
    
    import json
    
    j = json.loads('{"Age": "2", "Sex": "male"}')
    print j
    

or alternatively test it by loading it directly from the saved file using
[json.load()](https://docs.python.org/3/library/json.html#json.load):

    
    
    import json
    
    with open('file1.json', 'r') as f:
        j = json.load(f)
        print j
    

... seems to be valid.

