Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

python pygeoip example

def coun(attackerip):
	ip_tocoun_db='GeoLiteCity.dat'
	gi = pygeoip.GeoIP(ip_tocoun_db) 
        # IP details are returend as a directory
	rec = gi.record_by_name(attackerip) 
	country = rec['country_name']
	country =str(country)
	return country 
Source by www.programcreek.com #
 
PREVIOUS NEXT
Tagged: #python #pygeoip
ADD COMMENT
Topic
Name
2+8 =