Answers for "python as json"

1

python object to json

jsonStr = json.dumps(myobject.__dict__)
Posted by: Guest on March-27-2020
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

Python Answers by Framework

Browse Popular Code Answers by Language