I am trying to write a condition, under which a value in specified dictionary changes. However, every time I load the file its back to the original value. I would like to save the new value to the dictionary, so when the file is loaded again the new value would show.Any help is appreciated.
I've tried using a different python file for dictionary, but ended up with same results. I gave pickle module a try too. No success. Any help is appreciated.
from tkinter import *
dict = {'Andrew': [67, 78, 98], 'William': [56, 90, 42], 'Anna': [90, 88, 75]}
andrew_var = DoubleVar()
change_first_grade = Entry(root, textvariable=var)
change_first_grade.pack()
andrew_var.set(0)
if andrew_var.get() != 0:
dict['Andrew'][0] = andrew_var.get()
How can I make that when the value in dictionary changes, it is saved, so next time opening file would have had the new value in dictionary.