python json save to file 1

python json save to file

with open('output.json', 'w') as outfile:
    json.dump(data, outfile)

Here is what the above code is Doing:
1. We’re opening the file ‘output.json’ in write mode.
2. We’re dumping the data variable into the file.
3. We’re closing the file.

Similar Posts