0

I'm trying to print keys from a file of multiple dictionaries

I want to make it so that it only prints the items of a certain key. The file contains several dictionaries.

user
  • 19
  • 3
  • 1
    `json.load` and `json.loads` does not decode multiple json object, example: `json.loads('{}{}')` shows `Extra data: line 1 column 3 (char 2)`, view: [python-json-loads-shows-valueerror-extra-data](http://stackoverflow.com/questions/21058935/python-json-loads-shows-valueerror-extra-data) – Jose Ricardo Bustos M. Nov 25 '16 at 21:26
  • Can you show us how your input file is structured? Is it one line per dictionary? If that's the case you need to use readline (https://docs.python.org/2/tutorial/inputoutput.html) combined with a loop and append the dicts to a list of dicts, then iterate through the list to print the keys. – Qichao Zhao Nov 25 '16 at 21:33

0 Answers0