Riju21

42_api_python

May 12th, 2019
517
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.30 KB | None | 0 0
  1. import json
  2. from urllib.request import urlopen
  3. with urlopen('https://api.github.com/users?since=135') as res:
  4.     dataRead = res.read()
  5.  
  6.  
  7.  
  8. # load as string
  9. # ------------------
  10. dataLoad = json.loads(dataRead)
  11.  
  12.  
  13. # print as a format
  14. # -------------------
  15. print(json.dumps(dataLoad, indent=2))
Advertisement
Add Comment
Please, Sign In to add comment