会员
周边
众包
新闻
博问
闪存
所有博客
当前博客
我的博客
我的园子
账号设置
简洁模式
...
退出登录
注册
登录
lattesea
学无止境
博客园
首页
新随笔
联系
订阅
管理
2019年10月12日
python字典保存至json文件
摘要: import os import json class SaveJson(object): def save_file(self, path, item): # 先将字典对象转化为可写入文本的字符串 item = json.dumps(item) try: if not os.path.exists(path): with open(path, "w", encoding='utf-8') as
阅读全文
posted @ 2019-10-12 11:42 lattesea
阅读(8492)
评论(0)
推荐(1)
编辑
公告