<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	>
<channel>
	<title>Comments on: 使用Python查询纯真IP(最新修改，无乱码）</title>
	<atom:link href="http://www.linuxtoy.org/archives/python-ip.html/feed" rel="self" type="application/rss+xml" />
	<link>http://linuxtoy.org/archives/python-ip.html</link>
	<description>LinuxTOY 是一个致力于提供 Linux 相关资讯的专题站点。如果您发现了好用好玩的 Linux 东东并愿意发扬自由、分享的精神，可以点击顶部导航 Contact 按钮进行投稿。</description>
	<pubDate>Fri, 10 Feb 2012 05:54:30 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.5.1</generator>
		<item>
		<title>By: Demon</title>
		<link>http://linuxtoy.org/archives/python-ip.html#comment-267816</link>
		<dc:creator>Demon</dc:creator>
		<pubDate>Thu, 17 Nov 2011 13:42:40 +0000</pubDate>
		<guid isPermaLink="false">http://linuxtoy.org/?p=3099#comment-267816</guid>
		<description>&lt;p&gt;这个脚本存在一些可移植性的问题。
详见&lt;a href="http://demon.tw/programming/python-qqwry-dat.html" rel="nofollow"&gt;http://demon.tw/programming/python-qqwry-dat.html&lt;/a&gt;&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>这个脚本存在一些可移植性的问题。
详见<a href="http://demon.tw/programming/python-qqwry-dat.html" rel="nofollow">http://demon.tw/programming/python-qqwry-dat.html</a></p>]]></content:encoded>
	</item>
	<item>
		<title>By: hongleij</title>
		<link>http://linuxtoy.org/archives/python-ip.html#comment-232175</link>
		<dc:creator>hongleij</dc:creator>
		<pubDate>Fri, 19 Aug 2011 01:07:36 +0000</pubDate>
		<guid isPermaLink="false">http://linuxtoy.org/?p=3099#comment-232175</guid>
		<description>&lt;p&gt;CMD测试返回的是乱码是因为无法直接打印UTF-8的结果，你需要解码： print '%s %s/%s' % (ip, c.decode('utf-8'), a.decode('utf-8'))&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>CMD测试返回的是乱码是因为无法直接打印UTF-8的结果，你需要解码： print '%s %s/%s' % (ip, c.decode('utf-8'), a.decode('utf-8'))</p>]]></content:encoded>
	</item>
	<item>
		<title>By: singpenguin</title>
		<link>http://linuxtoy.org/archives/python-ip.html#comment-220052</link>
		<dc:creator>singpenguin</dc:creator>
		<pubDate>Wed, 20 Jul 2011 10:05:35 +0000</pubDate>
		<guid isPermaLink="false">http://linuxtoy.org/?p=3099#comment-220052</guid>
		<description>&lt;p&gt;按照楼主的方法测试成功了，不错windows下，使用CMD测试返回的是乱码，不知如何解决。&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>按照楼主的方法测试成功了，不错windows下，使用CMD测试返回的是乱码，不知如何解决。</p>]]></content:encoded>
	</item>
	<item>
		<title>By: 597so</title>
		<link>http://linuxtoy.org/archives/python-ip.html#comment-175061</link>
		<dc:creator>597so</dc:creator>
		<pubDate>Wed, 24 Nov 2010 12:52:37 +0000</pubDate>
		<guid isPermaLink="false">http://linuxtoy.org/?p=3099#comment-175061</guid>
		<description>&lt;p&gt;禁止远程登录&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>禁止远程登录</p>]]></content:encoded>
	</item>
	<item>
		<title>By: Hex</title>
		<link>http://linuxtoy.org/archives/python-ip.html#comment-162129</link>
		<dc:creator>Hex</dc:creator>
		<pubDate>Thu, 10 Jun 2010 10:17:29 +0000</pubDate>
		<guid isPermaLink="false">http://linuxtoy.org/?p=3099#comment-162129</guid>
		<description>&lt;p&gt;哦，出错是指的查询出错误的地址。
博主可以试试。&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>哦，出错是指的查询出错误的地址。
博主可以试试。</p>]]></content:encoded>
	</item>
	<item>
		<title>By: Hex</title>
		<link>http://linuxtoy.org/archives/python-ip.html#comment-162128</link>
		<dc:creator>Hex</dc:creator>
		<pubDate>Thu, 10 Jun 2010 10:16:23 +0000</pubDate>
		<guid isPermaLink="false">http://linuxtoy.org/?p=3099#comment-162128</guid>
		<description>&lt;p&gt;首先感谢楼主分享这么好的代码！&lt;/p&gt;

&lt;p&gt;我发现一个 bug:
就是 find 方法中的
if ip &#60;= new&lt;em&gt;ip:
应该改成
if ip &#60; new&lt;/em&gt;ip:&lt;/p&gt;

&lt;p&gt;否则在查找边界 ip 地址的时候会出错。&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>首先感谢楼主分享这么好的代码！</p>

<p>我发现一个 bug:
就是 find 方法中的
if ip &lt;= new<em>ip:
应该改成
if ip &lt; new</em>ip:</p>

<p>否则在查找边界 ip 地址的时候会出错。</p>]]></content:encoded>
	</item>
	<item>
		<title>By: lilo</title>
		<link>http://linuxtoy.org/archives/python-ip.html#comment-117904</link>
		<dc:creator>lilo</dc:creator>
		<pubDate>Fri, 03 Jul 2009 01:43:38 +0000</pubDate>
		<guid isPermaLink="false">http://linuxtoy.org/?p=3099#comment-117904</guid>
		<description>&lt;p&gt;自己解决了 不是ip库版本的问题
上面的程序是linux下的 所以打开文件的时候用的是
f = file(dbname, 'r')
在linux下没问题但是在windows下面打开二进制文件的话一定要用'rb'模式
所以程序里第49行改成
f = file(dbname, 'rb')
就可以了&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>自己解决了 不是ip库版本的问题
上面的程序是linux下的 所以打开文件的时候用的是
f = file(dbname, 'r')
在linux下没问题但是在windows下面打开二进制文件的话一定要用'rb'模式
所以程序里第49行改成
f = file(dbname, 'rb')
就可以了</p>]]></content:encoded>
	</item>
	<item>
		<title>By: lilo</title>
		<link>http://linuxtoy.org/archives/python-ip.html#comment-117903</link>
		<dc:creator>lilo</dc:creator>
		<pubDate>Fri, 03 Jul 2009 00:38:37 +0000</pubDate>
		<guid isPermaLink="false">http://linuxtoy.org/?p=3099#comment-117903</guid>
		<description>&lt;p&gt;跟楼上的情况一样....&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>跟楼上的情况一样....</p>]]></content:encoded>
	</item>
	<item>
		<title>By: lilo</title>
		<link>http://linuxtoy.org/archives/python-ip.html#comment-117902</link>
		<dc:creator>lilo</dc:creator>
		<pubDate>Fri, 03 Jul 2009 00:38:15 +0000</pubDate>
		<guid isPermaLink="false">http://linuxtoy.org/?p=3099#comment-117902</guid>
		<description>&lt;p&gt;同楼上的情况...&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>同楼上的情况...</p>]]></content:encoded>
	</item>
	<item>
		<title>By: chen_kevin</title>
		<link>http://linuxtoy.org/archives/python-ip.html#comment-117085</link>
		<dc:creator>chen_kevin</dc:creator>
		<pubDate>Tue, 23 Jun 2009 08:28:07 +0000</pubDate>
		<guid isPermaLink="false">http://linuxtoy.org/?p=3099#comment-117085</guid>
		<description>&lt;p&gt;我用了纯真20090620的版本，结果报错：
struct.error: unpack requires a string argument of length 4&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>我用了纯真20090620的版本，结果报错：
struct.error: unpack requires a string argument of length 4</p>]]></content:encoded>
	</item>
</channel>
</rss>

