摘要:
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: ... 阅读全文
摘要:
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模式写入 ... 阅读全文