Posts

Showing posts from December, 2020

JSON Library In Python - Loads/dumps/load/dump

 Using JSON library we can perform this main operation Method Description dumps() encoding to JSON objects dump() encoded string writing on file loads() Decode the JSON string load() Decode while JSON file read Python to JSON (Encoding) JSON Library of Python performs following translation of Python objects into JSON objects by default Python JSON dict Object list Array unicode String number - int, long number – int float number – real True True False False None Null JSON to Python (Decoding) JSON string decoding is done with the help of inbuilt method  loads()  &  load()  of JSON library in Python. Here translation table show example of JSON objects to Python objects which are helpful to perform decoding in Python of JSON string. JSON Python Object dict Array list String unicode number – int number - int, long number – real float True True False False Null None How to Convert String to JSON Object? When they send using request.data { "data": { "title":"tes...