#!/usr/bin/env python
import string
def ch1(num):
s = []
for i in range(4):
s.append(str(num %256))
num /= 256
return ‘.‘.join(s[::-1])
file_object = open(‘gslb.v101‘)
for line in file_object:
ip_list = line.split(‘ ‘)
print ch1(int(ip_list[0])),‘--->‘,ch1(int(ip_list[1]))
file_object.close( )
3549401088 3549421567
3549749248 3549757439
3671023616 3671056383
3719389184 3719391231
3729636096 3729636351
本文出自 “开发与运维” 博客,谢绝转载!
原文地址:http://yeqing.blog.51cto.com/3159086/1933374