User Tools

Site Tools


python:jsonprocessing

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
Last revisionBoth sides next revision
python:jsonprocessing [2016/08/03 08:58] – [Python Json] adminpython:jsonprocessing [2016/08/03 09:10] – [Create Json String(Json Encoder)] admin
Line 2: Line 2:
 refer: http://www.json.org/ refer: http://www.json.org/
 ===== Simple Example ===== ===== Simple Example =====
 +==== Parse Json String (Json Decoder)====
 +  * Performs the following translations in **decoding** by default:
 +
 +^JSON^Python^
 +|object|dict|
 +|array|list|
 +|string|unicode|
 +|number (int)|int, long|
 +|number (real)|float|
 +|true|True|
 +|false|False|
 +|null|None|
 +
   * Simple example for parsing Json:<code python>   * Simple example for parsing Json:<code python>
 import json import json
Line 12: Line 25:
 print parsed_json['first_name'] print parsed_json['first_name']
 </code> </code>
 +==== Create Json String(Json Encoder) ====
 +  * Supports the following objects and types by default:
 +
 +^Python^JSON^
 +|dict|object|
 +|list, tuple|array|
 +|str, unicode|string|
 +|int, long, float|number|
 +|True|true|
 +|False|false|
 +|None|null|
 +
 +  * Simple Example
 ===== Json to csv ===== ===== Json to csv =====
python/jsonprocessing.txt · Last modified: 2022/10/29 16:15 by 127.0.0.1