Advertisement
Guest User

Untitled

a guest
Oct 23rd, 2019
112
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.21 KB | None | 0 0
  1. import csv
  2. import json
  3. import sys
  4.  
  5. reader = csv.DictReader(open(sys.argv[1], "r"))
  6. lines = []
  7. for line in reader:
  8. lines.append(line)
  9.  
  10. open(sys.argv[1].replace(".csv", ".json"), "w").write(json.dumps(lines))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement