sábado, 27 de enero de 2018

working json on python

#!/usr/bin/env python3

import requests
r = requests.get('https://ipinfo.io/json')
print(r.text)
#print(r.json)
m=r.json()
print(m['city'])
print(m['hostname'])
print(m)

http://www.python-requests.org/en/master/

. Requests. The most famous http library written by kenneth reitz. It’s a must have for every python developer.

No hay comentarios:

Publicar un comentario