1def filewriter(line):
2 dictionary = {}
3 dictionary['name'] = line[0][0] #assume this is a a string
4 dictionary['item_to_buy'] = line[0][1]
5 dictionary['currency'] = line[0][2]
6 dictionary['league'] = line[0][3]
7 with open('logs.json', 'r+') as f:
8 if len(f.read()) == 0:
9 f.write(json.dumps(dictionary))
10 else:
11 f.write(',\n' + json.dumps(dictionary))
12
13def retrieve():
14 with open('logs.json') as f:
15 g = json.load(f)
16 print(g[1]['name'])
17