I'm trying to read the JSONs from a folder and get the proper values, I already tested all the JSONs to see if they were valid. The folder with the JSONs is called 'test'
for dirname, dirnames, filenames in os.walk('test'):
for filename in filenames:
with open(os.path.join(dirname,filename)) as fd:
json_data = json.load(fd)
print json_data
The idea is to go through the whole folder and all the files, reading them and showing the content. But on the run I get one:
ValueError: No JSON object could be decoded
This is a JSON:
{
"test": "Search User 1",
"url": "http://127.0.0.1:8000/api/v1/user/1/?format=json",
"status_code": 200,
"method": "get"
}