Bottom Page

Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
 JSON
#1
JSON looks like this

===========================
{
"op": {
"samples": {
"COL_1_RESULT": [
2533973817,
3745333807,
3745333807,
3745333807,
3745341999,
3745341999,
3745350191,
3745493551,
3745505839,
3745514031
],
"COL_2_RESULT": [
23,
22,
22,
22,
22,
22,
22,
22]
},
"samplesCount": 60,
"isPersistent": true,
"lastTStamp": 1562943374678,
"interval": 1000
}
}
===========================


res=requests.get(url, auth=HTTPBasicAuth('*******', '*******'))
json_data = json.loads(res.text)
print(json_data)

print(json_data['COL_2_RESULT'])
This doesnt work ......... I assume its simple - but :)

Worked it out.
Just need to fully qualify the nest. Each layer.
Quote

Top Page

Possibly Related Threads...
Thread Author Replies Views Last Post
  json.load() is making json file into string and not python disctionary Heisenberg 2 785 Jun-10-2018, 08:29 AM
Last Post: Larz60+
  Write lambda function in pyhhon to coy data from multiple JSON into a single JSON fil anandmn85 2 946 Apr-19-2018, 05:56 AM
Last Post: anandmn85

Forum Jump:


Users browsing this thread: 1 Guest(s)