1

When I print banner["STATUS"]["Description"], I get an empty value?

banner = {
  "STATUS":[
    {
      "STATUS": "S",
      "When": 1470157636,
      "Code": 11,
      "Msg": "Summary",
      "Description": "nsgminer 0.9.2"
    }
  ],
  "SUMMARY": [
    {
      "Elapsed":1502,
      "MHS av":0.00,
      "Found Blocks":0,
      "Getworks":58,
      "Accepted":0,
      "Rejected":0,
      "Hardware Errors":0,
      "Utility":0.00,
      "Discarded":116,
      "Stale":0,
      "Get Failures":2,
      "Local Work":180,
      "Remote Failures":0,
      "Network Blocks":17,
      "Total MH":0.0000,
      "Work Utility":0.00,
      "Difficulty Accepted":0.00000000,
      "Difficulty Rejected":0.00000000,
      "Difficulty Stale":0.00000000,
      "Best Share":0
    }
  ],
  "id":1
} 
1
  • 3
    banner['STATUS'][0]['Description'] Commented Aug 2, 2016 at 17:11

1 Answer 1

2
print banner['STATUS'][0]['Description'] # 0 will tell its the 0th index of the list

'Status' key holds a list. Since 'Description' is placed in the 1st dictionary in that list, [0] is needed to access the 1st dictionary.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.