标签:
[2016-01-18][python][查询IP所在地]1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | from urllib import request import json def GetIPCity(ip,city): data = f.read() st = json.loads(data.decode( ‘utf-8‘ )) city[ 0 ] = st[ ‘country‘ ] city[ 1 ] = st[ ‘province‘ ] city[ 2 ] = st[ ‘city‘ ] city = [" "," "," "] ip = "183.62.57.244" GetIPCity(ip,city) print (city) |
标签:
原文地址:http://www.cnblogs.com/qhy285571052/p/5138561.html