json
# 本身的Myjson
class Myjson(object):
def__init__(self, file):
self.file= file
self.obj= Myjson.generator(self.file)
def dump(self, obj):
withopen(self.file, mode='at', encoding='utf-8') asf:
json.dump(obj, f)
f.write('\n')
self.obj= Myjson.generator(self.file)