June 2015
Intermediate to advanced
192 pages
4h 8m
English
Python has had native support for JSON since Python 2.6 through the json module. Using the module is as simple as using the import statement to import the module and then accessing the encoder and decoder through the json object that it defines.
Simply enter the following in your source code to be able to reference the JSON facility:
import json
Here's a simple example from the Python interpreter:
>>> import json >>>json = '{ "call":"KF6GPE","type":"l","time":"1399371514", "lasttime":"1418597513","lat": 37.17667,"lng": -122.14650, "result" : "ok" }' u'{"call":"KF6GPE","type":"l","time":"1399371514", "lasttime":"1418597513","lat": 37.17667,"lng": -122.14650, "result": "ok" }' >>>result ...Read now
Unlock full access