标签: python-3.x
我的硬件地址格式为0000.f0h0.111g,需要使用python格式转换为MAC地址00:00:f0:h0:11:1g。
答案 0 :(得分:0)
这是一个解决方案
def convertFunc(mc): mc = mc.replace('.','') t = iter(mc) res = ':'.join(x+y for x,y in zip(t,t)) return res