I have a text file temp.txt
of the sort --
{
"names" : [ {"index" : 0, "cards": "\n\nbingo" ...} ]
"more stuff": ...
}
{
"names" : [ {"index" : 0, "cards": "\nfalse" ...} ]
"more stuff": ...
}
.
.
Here's how I am trying to load it --
def read_op(filename):
with open("temp.txt", 'r') as file:
for line in file:
print (json.load(line))
return lines
But this throws the error:
JSONDecodeError: Expecting property name enclosed in double quotes: line 2 column 1
I'm not sure what I am doing wrong here. Are there alternatives to reading this file another way?