def main():
with open("tasks.json", "r") as f:
pass
#code here to return back into objects
while True:
print("\nTASK TRACKER\n")
option_choice = show_options(options)
if option_choice is None:
exit_program()
options[option_choice - 1].func()
this is where I write to the json
def exit_program():
print("Exiting program...")
for task in tasks:
jsonlist = [dataclasses.asdict(task) for task in tasks]
with open("tasks.json", "w") as f:
json.dump(jsonlist, f)