get_ip_address
·
#!usr/bin/env python
# -*- coding: utf-8 -*-
"""
"""
import json
from urllib.request import urlopen
def get_country(ip_address):
'''Get ip_address!
'''
response = urlopen("http://freegeoip.net/json/"+ ip_address).read().decode("utf-8")
response_json = json.loads(response)
return response_json
IP_1 = "222.35.76.57"
IP_2 = "111.201.37.159"
IP_3 = "121.97.110.145"
IP_4 = "60.205.112.186"
print(get_country(IP_4))更多推荐



所有评论(0)