From 8967d834f1a26c806243cab7f1aa7830f4fb5221 Mon Sep 17 00:00:00 2001 From: theoptips Date: Sun, 17 Nov 2013 00:20:14 -0800 Subject: [PATCH] Update csv-to-json.py added double quotes around observations, else won't output valid JSON --- ch02/csv-to-json.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ch02/csv-to-json.py b/ch02/csv-to-json.py index 522fb5f..be9da07 100644 --- a/ch02/csv-to-json.py +++ b/ch02/csv-to-json.py @@ -2,7 +2,7 @@ reader = csv.reader(open('wunder-data.txt', 'r'), delimiter=",") -print "{ observations: [" +print '{ "observations": [' rows_so_far = 0 for row in reader: @@ -18,4 +18,4 @@ else: print " }" -print "] }" \ No newline at end of file +print "] }"