#!/usr/bin/env python
#-*- coding:utf-8 -*-
''' 给一个MAC地址加1 '''
mac = '52:54:00:e6:b2:0a'
prefix_mac = mac[:-2]
last_two = mac.split(':')[-1].lower()
new_last_two = int(last_two, 16) + 1
new_last_two = hex(new_last_two).split('x')[-1]
if len(str(new_last_two)) == 1:
new_last_two = '0' + new_last_two
new_mac = prefix_mac + new_last_two
print(new_mac)
【说明】:本文章由站长整理发布,文章内容不代表本站观点,如文中有侵权行为,请与本站客服联系(QQ:254677821)!