From 1797d3a729debcadffec92ad2e44c2c7603170f3 Mon Sep 17 00:00:00 2001 From: Alessio Date: Dec 27 2020 12:10:49 +0000 Subject: test --- diff --git a/generate.py b/generate.py index 2d947ae..dbcbc2e 100644 --- a/generate.py +++ b/generate.py @@ -6,10 +6,25 @@ f = open('list.json',) # a dictionary data = json.load(f) +print("" +"" +"") + +print("

Press review

") + # Iterating through the json # list for i in data['articles']: - print(i['a']) + print("

") + print("Title: %s " % i['title']) + print("Source: %s " % i['source']) + print("Date: %s " % i['date']) + print("Excerpt: %s " % i['excerpt']) + print("Link: %s " % i['link']) + print("

") # Closing file f.close() + +print("" +"") diff --git a/list.json b/list.json index 367bc2f..8ca1ce5 100644 --- a/list.json +++ b/list.json @@ -1,6 +1,18 @@ { "articles": [ - {"a":1,"b":1.2,"c": 1.2}, - {"a":4,"b":4.2,"c": 4.4} + { + "title": "title2", + "source": "source2", + "date": "2020-12-27", + "excerpt": "aaaa", + "link": "http://link2" + }, + { + "title": "title1", + "source": "source1", + "date": "2020-12-21", + "excerpt": "dded", + "link": "http://link1" + } ] }