I am writing up something that will eventually output a json file.
This is what I have for testing at the moment
import json
my_list = [1, 2, 3]
my_dict = {"key": "value", "boolean": True}
my_json = {"object": my_dict, "array": my_list}
print(json.dumps(my_json, indent=4))
This will output:
{
"object": {
"key": "value",
"boolean": true
},
"array": [
1,
2,
3
]
}
What I don't want is a newline after each value in an array, purely for aesthetic purposes i.e.
"array": [1, 2, 3]
How would I go about doing this?