1.eval

2.json

# NameError: name
# 'null' is not defined
# i_dict=eval(i)
这种方式,如果dict字符串中有null ,将不能变成dict


 i_dict = json.loads(i)

#将str类型转化为dict policy = json.loads(p) #将dict类型转化为str p = json.dumps(policy)

 

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-10-04
  • 2021-08-19
  • 2021-11-06
  • 2021-10-12
  • 2022-12-23
猜你喜欢
  • 2021-12-04
  • 2021-11-16
  • 2021-06-16
  • 2022-12-23
  • 2021-11-04
  • 2021-06-10
相关资源
相似解决方案