How can I permanently update static variables in a class?
I found Static variables in python classes. However, this updates the variable only for the current script. When I reload my module, the variables are reset to there original initialized values.
Like suppose I want to store the number of instances of a class created by all the users till date. But whenever a user imports my class from the module, it resets the initial count to 0.
I am thinking a solution might be to store the variables in a file and every time my class is instantiated, update variables in the file.
Please suggest some better approach. Thanks for your help.