Quantcast
Channel: printing first 10 lines of my feed - Stack Overflow
Browsing latest articles
Browse All 2 View Live

Answer by Alex Taylor for printing first 10 lines of my feed

Using [:10] as a slice will get you up to the first 10 elements:import jsonwith open('output.json', encoding='utf-8') as json_file: output = json.loads(json_file.read())feeds = []for feed in output...

View Article



printing first 10 lines of my feed

import json with open('output.json', encoding='utf-8') as json_file: output = json.loads(json_file.read())feeds = []for feed in output ['posts']: feeds.append (feed)print (feeds[1]['title'])I am trying...

View Article
Browsing latest articles
Browse All 2 View Live




Latest Images