Answers for "python json from csv"

-1

python json from csv

import csv
import json

csvfile = open('file.csv', 'r')
jsonfile = open('file.json', 'w')

fieldnames = ("FirstName","LastName","IDNumber","Message")
reader = csv.DictReader( csvfile, fieldnames)
for row in reader:
    json.dump(row, jsonfile)
    jsonfile.write('\n')
Posted by: Guest on May-22-2020

Code answers related to "Javascript"

Browse Popular Code Answers by Language