Q:

How to set radioButton's default selected in TKinter to be the one that was selected before the program ended?

I have two radio buttons in my GUI application, I am able to select which radio button is set to default by using the .set() method. But how can I leave the default one be the one that the user last choose in his/her last session before closing the program?
Thank you in advance.

A:

Use persistent data.
Say that the radiobutton's value that the user set in 1, save 1 to a file, and focus the radiobutton to the variable pulled from the file at next restart.
This might help: https://docs.python.org/3/library/pickle.html

