How to write a large number of nested records in JSON with Python

Posted by jamesmcm on Stack Overflow See other posts from Stack Overflow or by jamesmcm
Published on 2012-06-21T14:53:30Z Indexed on 2012/06/21 15:16 UTC
Read the original article Hit count: 217

Filed under:
|
|
|

I want to produce a JSON file, containing some initial parameters and then records of data like this:

{
 "measurement" : 15000,
 "imi" : 0.5,
 "times" : 30,
 "recalibrate" : false,
 {
  "colorlist" : [234, 431, 134]
  "speclist" : [0.34, 0.42, 0.45, 0.34, 0.78]
 }
 {
  "colorlist" : [214, 451, 114]
  "speclist" : [0.44, 0.32, 0.45, 0.37, 0.53]
 }
 ...
}

How can this be achieved using the Python json module? The data records cannot be added by hand as there are very many.

© Stack Overflow or respective owner

Related posts about python

Related posts about JSON