1 giskard@Vavatch ~/Informatique % ./Untitled.py                                                                                                                                                                  :(
Traceback (most recent call last):
  File "./Untitled.py", line 8, in <module>
    data = [json.loads(line) for line in lines]
  File "./Untitled.py", line 8, in <listcomp>
    data = [json.loads(line) for line in lines]
  File "/usr/lib/python3.6/json/__init__.py", line 354, in loads
    return _default_decoder.decode(s)
  File "/usr/lib/python3.6/json/decoder.py", line 339, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
  File "/usr/lib/python3.6/json/decoder.py", line 357, in raw_decode
    raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
1 giskard@Vavatch ~/Informatique % cat Untitled.py                                                                                                                                                                :(
#!/bin/python3
# coding: utf-8
import json

file_path = "./logs.json"
contents = open(file_path, "r").read() 
lines = contents.split('\n')
data = [json.loads(line) for line in lines]
giskard@Vavatch ~/Informatique % cat logs.json
{"time" : "2017-07-11 23:15:00", "model" : "Acurite 606TX Sensor", "id" : 73, "battery" : "LOW", "temperature_C" : 27.900}
{"time" : "2017-07-11 23:15:25", "model" : "Generic temperature sensor 1", "id" : 7, "temperature_C" : 169.800, "battery" : 1}
giskard@Vavatch ~/Informatique %