11

【笔记】JSON字符串与Python对象互转

 1 year ago
source link: https://loli.fj.cn/2023/03/04/JSON%E5%AD%97%E7%AC%A6%E4%B8%B2%E4%B8%8EPython%E5%AF%B9%E8%B1%A1%E4%BA%92%E8%BD%AC/
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

【笔记】JSON字符串与Python对象互转

2023-03-04

JSON字符串与Python对象互转

JSON字符串转换为Python对象

<str>:JSON格式字符串

import json

json.dumps(<str>)

Python对象转换为JSON字符串

<obj>:Python对象

import json

json.loads(<str>)

知乎——朱小五


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK