Generally you'd make a save function, when the game closes, or a level completes, copy all of your variables into the dictionary, and save the dictionary. Then on startup, you load the dictionary and copy the values back out.
There are other ways, but this is the simplest and safest.