I have two json files that I'd like to open to read from and instead of calling the open() function twice to open the json files individually, I tried this:
with open('./file_paths.txt') as file_list:
for filename in file_list:
json_data = json.load(file_list)
where in the './file_paths.txt'
file I've got two paths listed like this:
./dataset_1.json,
./dataset_2.json
I have a comma separating them. I tried enclosing them in quotation marks but I'm still getting the same error:
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
There is a problem with this line:
json_data = json.load(file_list)
in that I think the problem is how I've listed the filepaths in the .txt file.