My dictionary in a JSON file looks like this:
{
'key1':value1
'key2':value2
}
I'm writing a loop where each iteration adds a new key to the dictionary in the file. For example, after one iteration the dictionary in the file looks like this:
{
'key1':value1
'key2':value2
'key3':value3
}
I want to use a method to directly append a new key into the dictionary in the file. I don't want to have to read the file in, change data and write it back out again. Is there any way to do this?