0
需要计算IP => INT就像在这里:翻译一行请从蟒蛇红宝石
https://bitbucket.org/lorien/django-ipgeo/src/d19648c9b14f/ipgeo/models.py 但在红宝石。
我在红宝石很新,所以不能转化为红宝石这样的:
number = struct.unpack('!L', socket.inet_aton(ip))[0]
结构,插座是蟒蛇性病,IP就像是 '127.0.0.1'
字符串
要密切选民:以何种方式为这个问题“难以确定”?这个问题非常,非常清楚和精确。他希望python中特定行的等价ruby代码 - 并且在python中没有任何关于该行的含义。 – Arafangion