#!/usr/bin/env python
#-*-coding:utf8-*-
'''C transition to IP address '''
def macip(argv):
mac = []
for i in argv.split(':'):
mac.append(int(i,16))
mac="%s.%s.%s.%s.%s.%s" %tuple(mac)
return mac[6:]
if __name__ == '__main__':
print macip("00:1c:c0:a8:0a:5b")
print macip("00:0c:dd:12:da:da")
本文转自 swq499809608 51CTO博客,原文链接:http://blog.51cto.com/swq499809608/1227660