#1 I actually just copied it from my game, which i saved the JSON in a directory called save. And i didnt bother to change it.
#2 no. Once you load the json data, that is basically a dictionary. Im not sure why you have such as problem with using global variables VS dictionary keys? It does not pollute your namespace, and is much simpler to load/save. You also dont need to change the save/loading code if you add or remove a key, whereas you have to if you use variables as in your initial post. Less modification of code is less chance of bugs.
#3 in my example it is named "database{}".format(sys.version.split()[0]) which if your using python2.7.12 then the database name will be "database2.7.12", if your using python3.6.0 then your database name would be "database3.6.0".
#2 no. Once you load the json data, that is basically a dictionary. Im not sure why you have such as problem with using global variables VS dictionary keys? It does not pollute your namespace, and is much simpler to load/save. You also dont need to change the save/loading code if you add or remove a key, whereas you have to if you use variables as in your initial post. Less modification of code is less chance of bugs.
#3 in my example it is named "database{}".format(sys.version.split()[0]) which if your using python2.7.12 then the database name will be "database2.7.12", if your using python3.6.0 then your database name would be "database3.6.0".
Recommended Tutorials: