From: Karol L. <kar...@kn...> - 2007-11-19 13:30:16
|
Hi, A clarification on my latest commit. Since I started to use a different JSON encoder/decoder than simplejson, I decided to add support for them in cclib. One of simplejson, cjson ot json is loaded dynamically when load_json() is called in data.py. It is only loaded once, unless an optional argument for the module name is passed (can be passed through read_json, etc.). An example: >>> import cclib >>> m = cclib.parser.ccopen("dvb_sp.out").parse() (...) >>> m.writejson(outfile="x.simplejson", module="simplejson") >>> m.writejson(outfile="x.json", module="json") >>> m.writejson(outfile="x.cjson", module="cjson") This writes three files using the three different modules. So, x.cjson is 63K x.json is 69K x.simplejson is 105K I don't know if any of these modules is better or faster or if it matters, but since simplejson was first it is the default (being the first to try to load). Cheers, Karol -- written by Karol Langner Mon Nov 19 14:26:59 CET 2007 |