摘要: import json class My_json: # 定义json类 def __init__(self, path): # 初始化方法 self.file = path def dump(self, obj): # 方法 with open(self.file, 'a', encoding='utf-8') as f: ... 阅读全文
posted @ 2019-06-05 00:34 CongShao's 阅读(125) 评论(0) 推荐(0) 编辑
摘要: import pickle # 导入pickle模块 class My_pickle: # 定义pickle类 def __init__(self, path): self.file = path def dump(self, obj): with open(self.file, 'ab') as f: # 以ab模式写入 ... 阅读全文
posted @ 2019-06-05 00:30 CongShao's 阅读(331) 评论(0) 推荐(0) 编辑