I have a file called test.json with the following content.
{
"Nederbördsmängd": "7",
"Rådande väder": "13"
}
I want to load it into my python script as a json-object.
with open("test.json",encoding='UTF-8') as json_data_file:
schema = json.load(json_data_file)
print(json.dumps(schema,indent=2))
The output:
{
"Nederb\u00f6rdsm\u00e4ngd": "7",
"R\u00e5dande v\u00e4der": "13"
}
When I print the file directly without converting it to a json-object it works as expected.
with open("test.json",encoding='UTF-8') as json_data_file:
print(json_data_file.read())
The output:
{
"Nederbördsmängd": "7",
"Rådande väder": "13"
}
How do I load my file into my script as a json object without altering its content? I'm using python 3.9.7.