随笔- 26  文章- 0  评论- 10 
2007年7月5日

 

def Ip2Int(ip):
    
import struct,socket
    
return struct.unpack("!I",socket.inet_aton(ip))[0]


def Int2Ip(i):
    
import socket,struct
    
return socket.inet_ntoa(struct.pack("!I",i))

posted @ 2007-07-05 11:24 thh 阅读(697) 评论(0) 编辑