# database:http://acupun.site/lecture/jquery_phoneGap/json/book.json #there are 2 solutions to read database in python #(1).pandas #(2).urllib.request + json import urllib.request as request web = request.urlopen("http://acupun.site/lecture/jquery_phoneGap/json/book.json") txt = web.read() #transfer the json into dict import json d1 = json.loads(txt) print() print('1.output all records=', d1) print() print('2.output 1st record=',d1[0]) print('3.output the title of 1st record=',d1[0]['title']) print('4.output the author of 1st record=',d1[0]['author']) print() # output the name, author for all records for item in d1: print(item['title'],item['author'])