python 简单实现ip位置查找

in #python6 years ago

python 简单实现ip位置查找

好久没来steem 了 ,今天刚好需要找一个模糊识别ip地址的小工具 就分享出来

用的github大佬写的工具,和自己收集的ip库

github 地址: https://github.com/ipipdotnet/ipdb-python

源码:

import ipdb
db = ipdb.Reader("ip.ipdb")
# print(db.find("2001:250:200::"))
# print(db.find_map("2001:250:200::"))
while(1):
    a = input("请输入ip: ")
    info = db.find_info(a)
    print(info.country_name, info.region_name, info.city_name, info.owner_domain, info.isp_domain, info.latitude,
          info.longitude, info.timezone, info.utc_offset)

ip.ipdb 这个自己去下载 运行结果如下:

微信图片_20181029182612.png

Sort:  

这么容易的么 准确不

还行 到省级 还能精准到哪里呀 你说呢

技术流 厉害

厉害了

Posted using Partiko Android

Congratulations @webshell! You have completed the following achievement on the Steem blockchain and have been rewarded with new badge(s) :

You received more than 250 upvotes. Your next target is to reach 500 upvotes.

Click here to view your Board of Honor
If you no longer want to receive notifications, reply to this comment with the word STOP

Do not miss the last post from @steemitboard:

Trick or Treat - Publish your scariest halloween story and win a new badge
SteemitBoard notifications improved

Support SteemitBoard's project! Vote for its witness and get one more award!

Congratulations @webshell! You have completed the following achievement on the Steem blockchain and have been rewarded with new badge(s) :

You got your First payout

Click here to view your Board of Honor
If you no longer want to receive notifications, reply to this comment with the word STOP

Do not miss the last post from @steemitboard:

SteemFest³ - SteemitBoard Contest Teaser
The new Steemfest³ Award is ready!

Support SteemitBoard's project! Vote for its witness and get one more award!

Congratulations @webshell! You have completed the following achievement on the Steem blockchain and have been rewarded with new badge(s) :

You made more than 1250 upvotes. Your next target is to reach 1500 upvotes.

Click here to view your Board of Honor
If you no longer want to receive notifications, reply to this comment with the word STOP

Do not miss the last post from @steemitboard:

The Meet the Steemians Contest is over - Results are coming soon ...

Support SteemitBoard's project! Vote for its witness and get one more award!