PDA

View Full Version : Grid with Python processing page



strimp099
24 Mar 2011, 9:08 AM
I am attempting to populate a grid with JSON data from a Python processing page. The only way I can print the JSON object from the Python page is to print out the content header and an extra print line. The JSON object is being passed properly which I compared to a JSON object created from a similar PHP page - the objects are identical (confirmed through Firebug). The JSON from the Python page will not create the grid while the identical JSON object from the PHP page does.

The only thing I can fathom that is that the extra print statement on the Python page is preventing the grid from properly rendering. For example:




print "Content-Type: application/json"
print # <-- I think this is the problem

import json

print json.dumps(["a":1, "b",2])



This object is properly passed but does not populate the grid while




$a = array("a"=>1,"b"=>2);
print json_encode($a);



does populate the grid. Without the extra print line, Python throws an error.

Has anyone had luck populating a grid from a Python processing page? Thanks!