'''
Saisie de questions courantes, auxquelles des réponses adaptées sont attendues

@author: olivier.massot, jan 2018
'''
import json


instr = ""

with open("data.json", encoding="utf-8") as f:
    data = json.load(f)

while not instr == ".":
    instr = input("> ")
    if instr:
        if instr in data:
            print("# Déjà en mémoire")
        else:
            data[instr] = {}
            with open("data.json", "w+", encoding="utf-8") as f:
                json.dump(data, f)
