import json

 

json = '{"code": 0}'

 

# Deserialize ``s`` (a ``str``, ``bytes`` or ``bytearray`` instance containing a JSON document) to a Python object.

obj = json.loads(json)

 

# <class 'dict'>

print(type(obj))

 

print(obj['code'])

 

Refer:在线运行Python代码

Link:https://www.cnblogs.com/farwish/p/13219131.html

相关文章:

  • 2021-11-01
  • 2021-10-01
  • 2021-12-19
  • 2022-12-23
  • 2021-12-09
  • 2022-02-07
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-02-16
  • 2022-12-23
  • 2021-12-27
  • 2022-12-23
相关资源
相似解决方案