Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

convert a python object like dict, list, etc to a json object

# convert a python object like dict, list, etc to a json object
import json 
data = {
    "id": "123",
    "name": "John Doe",
    "occupation": "Farmer"
} 
json_object = json.dumps(data, indent = 4)
print(json_object)
Source by medium.com #
 
PREVIOUS NEXT
Tagged: #convert #python #object #json #object
ADD COMMENT
Topic
Name
7+5 =