我的設備將發送JSON數據是這樣的:如何解析python中的多個json數據?
[{"channel":924125000, "sf":10, "time":"2017-05-11T16:56:15", "gwip":"192.168.1.125", "gwid":"00004c4978dbf5b4", "repeater":"00000000ffffffff", "systype":5, "rssi":-108.0, "snr":17.0, "snr_max":23.3, "snr_min":10.8, "macAddr":"00000000000000c3", "data":"4702483016331210179183", "frameCnt":1, "fport":2}]
但有時我接收到多個JSON數據(兩個或更多):
[{"channel":924125000, "sf":10, "time":"2017-05-11T16:56:15", "gwip":"192.168.1.125", "gwid":"00001c497b48dbf5", "repeater":"00000000ffffffff", "systype":5, "rssi":-108.0, "snr":17.0, "snr_max":23.3, "snr_min":10.8, "macAddr":"00000000050100e8", "data":"4702483016331210179183", "frameCnt":1, "fport":2}],[{"channel":924125000, "sf":10, "time":"2017-05-11T16:56:15", "gwip":"192.168.1.125", "gwid":"00001c497b48dbf5", "repeater":"00000000ffffffff", "systype":5, "rssi":-108.0, "snr":17.0, "snr_max":23.3, "snr_min":10.8, "macAddr":"00000000050100e8", "data":"4702483016331210179183", "frameCnt":1, "fport":2}]
當我解析多個JSON數據
json_Dict = json.loads(jsonData)
then
File "/usr/lib/python2.7/json/decoder.py", line 369, in decode raise ValueError(errmsg("Extra data", s, end, len(s))) ValueError: Extra data: line 1 column 303 - line 1 column 1818 (char 302 - 1817)
如何解析每個多個json數據?
感謝您的幫助