simbioII / memory.py
antonypamo's picture
Upload 10 files
8a6ce4a verified
raw
history blame contribute delete
264 Bytes
import json, os
class MemoryStore:
def __init__(self, path):
self.path = path
if not os.path.exists(path): open(path, 'w').close()
def add(self, record):
with open(self.path, 'a') as f:
f.write(json.dumps(record) + "\n")