Blog

Accessing data in json lists python

Posted by:

At this point this is sort of a note to self, but I struggled with the format to access data from a json list imported into my python script.  Here is the format:

  1. for eachEntry in rigData:
  2. controllerName = eachEntry
  3. #print('eachEntry is: ' + str(eachEntry))#The name for each list
  4. for eachList in rigData[eachEntry]:
  5. #print('eachList: ' + str(eachList))#The values of each list in the root of data
  6. for eachListEntry in [eachList]:
  7. print('eachListEntry: ' + str(eachListEntry))#This is the value for each key in each list
  8. for eachKey, eachValue in eachListEntry.iteritems():
  9. print('eachKey: ' + str(eachKey))#This is the value for each key in each list
  10. print('eachValue: ' + str(eachValue))#This is the value for each key in each list
0
  Related Posts
  • No related posts found.

You must be logged in to post a comment.