📜  如何在 python 代码示例中制作 ip 跟踪器

📅  最后修改于: 2022-03-11 14:45:04.205000             🧑  作者: Mango

代码示例1
import os
import urllib2
import jsonwhile True:
ip=raw_input (“what is your target ip:”)
url = “http://ip-api.com/json/”
response = urllib2.urlopen (url +ip)
data = response.read()
values = json.loads(data)print(“IP:” + values [‘query’])
print(“City:” + values [‘city’])
print(“ISP:” + values [‘isp’])
print(“Country:” + values [‘country’])
print(“Region:” + values [‘region’])
print(“Time Zoen:” + values [‘timezone’])break