Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

python pygeoip example

>>> gi = pygeoip.GeoIP('GeoIP.dat')
>>> gi.country_code_by_name('google.com')
'US'
>>> gi.country_code_by_addr('64.233.161.99')
'US'
>>> gi.country_name_by_addr('64.233.161.99')
'United States'
Source by pygeoip.readthedocs.io #
 
PREVIOUS NEXT
Tagged: #python #pygeoip
ADD COMMENT
Topic
Name
2+4 =