GithubHelp home page GithubHelp logo

17monip's Issues

能不能替换掉mmap模块

我的应用布署在sae上面,我想是否可以个性一个通用的版本,当然可能会增加系统开销。替换掉mmap模块。使用更为通用的stringio 之类的。异或是可以提供转换dat至数据库的方法。。。。

Hadoop中如何使用IP.find()

本地使用IP.find()都是正常的,

import IP
IP.find("www.baidu.com")
'**\t浙江\t杭州'
IP.find("127.0.0.1")
'本机地址\t本机地址'

但是,我现在正在用Python写Hadoop的map, reduce任务,需要在map, reduce中调用IP.find(),
请问具体如何做到?需要怎么打包IP模块到Hadoop中?

建议更新到最新的数据文件

使用最新的数据库文件可以解析到具体的某个市了(原来只能到省),经过测试,只需要更新一下数据库文件17monipdb.dat就可以。

安装完之后的可执行文件冲突

Linux本身有自带名叫ip的命令,安装完成之后17monip也会生成一个名字叫ip的可执行文件,和原有的系统自带的ip冲突了,造成开机时进行网络配置不能。

提示错误:UnicodeEncodeError: 'ascii' codec

#!/usr/bin/python
# encoding: utf-8
"""IP地址转换"""

import IP

location = IP.find('www.baidu.com')

print location

Traceback (most recent call last):
File "d:\www\spider\logip2location\cron.py", line 9, in
print location
UnicodeEncodeError: 'ascii' codec can't encode characters in position 0-1: ordinal not in range(128)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.