pythonic way to manage a large amount of parameters for a full screen application (e.g. pygame)

Question:

I am developing an application using pygame that has a large amount of variable parameters (20+). Initially I had set different keys on my keyboard to increase and decrease these values, but I have now reached the keylimit with this method and would like to find a better method of managing these variables without having to minimize or restart the application each time.

One idea I had was to use a second laptop and set up an ssl connection (e.g. with a lan wire) to modify a json file with all the relevant settings on the computer the pygame application is running on. The application would regularly check if the file has been updated and apply any changes made to the file on runtime. Would that be a good effective solution to this problem? What can I do if my computer does not have a lan cable slot? Are there any more efficient methods to achieve the same results?

Asked By: Yes

||

Answers:

I decided to store the parameters I would like to modify in a separate dictionary and constantly update both the dictionary and a yaml file with all those values to look for changes made by the program or the user, and adjust the class variables at runtime when the yaml file is modified or update the yaml file when the class variables are modified by the program.

Answered By: Yes
Categories: questions Tags: , ,
Answers are sorted by their score. The answer accepted by the question owner as the best is marked with
at the top-right corner.