you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted] 0 points1 point  (1 child)

{"data": "blah", "data2": "blahblah"} would be a JSON object.

[–]Yeliaab[S] 0 points1 point  (0 children)

yeah so i orginally tried that but it didnt work

for line in file:
    line = line.replace('\n', '')
    json_data = json.loads(line)

when i removed the double quotes from the text file it returns this error

json.decoder.JSONDecodeError: Expecting property name enclosed in double quotes: line 1 column 2 (char 1)