1. 首页
  2. 行业
  3. 金融
  4. GeoLiteCity.zip

GeoLiteCity.zip

上传者: 2020-12-09 18:43:28上传 ZIP文件 11.16MB 热度 8次
通过ip查询国家和城市的库,需要先pip install geoip,然后把该文件的地址放到对应的位置上。 class GeoIP(object): def __init__(self, db="GeoLiteCity.dat"): self.gi = pygeoip.GeoIP(db, pygeoip.MEMORY_CACHE) def region(self, ip): res = {} info = self.gi.record_by_addr(ip) res["country"] = info["coun
下载地址
用户评论