我可以使用URL作为geoip2中读取器功能的数据库目录吗?

时间:2016-08-23 17:36:36

标签: python python-2.7 geolocation geoip maxmind

我正在运行

chartOptions: Ember.computed('array', function(){
    return  {

      chart: {
         renderTo: 'container',
         margin: 100,
         type: 'scatter',
         options3d: {
             enabled: true,
             alpha: 10,
             beta: 30,
             depth: 250,
             viewDistance: 5,
             fitToPlot: false,
             frame: {
                 bottom: { size: 1, color: 'rgba(0,0,0,0.02)' },
                 back: { size: 1, color: 'rgba(0,0,0,0.04)' },
                 side: { size: 1, color: 'rgba(0,0,0,0.06)' }
             }
         }
     },
     title: {
         text: 'XYZ'
     },
     subtitle: {
         text: 'Click on point to find coordinates'
     },
     plotOptions: {
         scatter: {
             width: 10,
             height: 10,
             depth: 10
         }
     },
     yAxis: {
         min: -10,
         max: 10,
         title: null
     },
     xAxis: {
         min: -10,
         max: 10,
         gridLineWidth: 1
     },
     zAxis: {
         min: -10,
         max: 10,
         showFirstLabel: false
     },
     legend: {
         enabled: false
     },
     series: [{
         name: 'Reading',
         colorByPoint: true,
         data: this.get('array')
     }]

    }
  })

它返回

import geoip2.database
reader = geoip2.database.Reader("https://url.com/.../GeoLite2-City.mmdb")

我有什么方法可以引用网址作为此功能的目的地吗?

编辑:

IOError: [Errno 2] No such file or directory: 'https://url.com/.../GeoLite2-City.mmdb'

返回

import geoip2.database
import urllib2
r = urllib2.urlopen("https://url.com/.../GeoLite2-City.mmdb")
temp = r.read()
reader = geoip2.database.Reader(temp)

0 个答案:

没有答案