Hi all , I've saved the results from my menu to json. when i click on the saved file it looks like it is only saving 1 dictionary and then overwriting it the next time the programme is run and the menu has new selections.
This is the code i have written. Thanks in advance.
This is the code i have written. Thanks in advance.
data = {} data['batch_number'] = [] data['batch_number'].append({'batch_number':str(batch_number)}) with open('fruitBatches.json', 'w') as outfile: json.dump(data, outfile) i = 0 while i < len(batch_number): print("list index is ", i) print("value is ", batch_number[i]) i = i + 1