# -*- coding: utf-8 -*-
import urllib,urllib2,json

ip=raw_input("输入查询的ip地址:")
url ='http://apis.baidu.com/apistore/iplookupservice/iplookup?ip='+ip
req=urllib2.Request(url)
req.add_header("apikey","a352e334f320a3a39fc62d2f05152e86")
resp=urllib2.urlopen(req)
content=resp.read()
if content:
   print content.decode('unicode_escape')



Logo

加入社区!打开量化的大门,首批课程上线啦!

更多推荐