I am exporting a dictionary containing values as list to a json file, but I am facing a indentation problem...
import json
null=None
json_data={
'A': [null, null],
'B': [null, null],
'C': [null, null]
}
outfile=open('Export.json',"w")
json.dump(json_data, outfile, indent=2)
outfile.close()
What I get inside the json file:
{
'A': [
null,
null
],
'B': [
null,
null
]
'C': [
null,
null
]
}
What I expected:
{
'A': [null, null],
'B': [null, null],
'C': [null, null]
}
I used sort_keys=False but still getting the same output, what can I do?