Python:json 模块

FLowUs邀请链接:https://flowus.cn/login?code=AXNU63
FlowUs邀请码:AXNU63


字符串转dict、list

data = "[{....},{...},...]"
list_data = json.loads(data)

dict、list转字符串

list = ...
list_str = json.dumps(list)

dict、list 写入文件

json.dump(obj, fp)

从文件中读取 dict、list

data = json.load(fp)
posted @ 2020-01-26 21:03  wbytts  阅读(347)  评论(0编辑  收藏  举报