Answers for "print json data"

3

python to json

# a Python object (dict):
x = {
  "name": "John",
  "age": 30,
  "city": "New York"
}

# convert into JSON:
y = json.dumps(x)
Posted by: Guest on May-02-2020
0

print json object

ObjectMapper mapper = new ObjectMapper();
System.out.println(mapper.writerWithDefaultPrettyPrinter().writeValueAsString(jsonObject))
Posted by: Guest on July-06-2021

Python Answers by Framework

Browse Popular Code Answers by Language