change the value of a variables on the fly
This code changes the value of a variable on the fly:
a = 1
a = 2
Your question suggests that you want to be able to look up a value by a calculated name. The solution is to use a dict
:
mydict = {'corrector':0}
mydict['corrector'] = 1
If you want to change the values in the file, you'll need to write out a new file based on the data you have. It looks like you're loading json, so the json
module will help you out with that.