Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

python pygeoip example

def load_geoip():
    import pygeoip
    from pygeoip.const import MEMORY_CACHE
    
    resource_package = __name__
    filename = pkg_resources.resource_filename(resource_package, 'GeoIP.dat')
    return pygeoip.GeoIP(filename, flags=MEMORY_CACHE) 
Source by www.programcreek.com #
 
PREVIOUS NEXT
Tagged: #python #pygeoip
ADD COMMENT
Topic
Name
7+5 =