python 获取mac地址
1 2 3 4 |
def get_mac_address(self): import uuid mac = uuid.UUID(int = uuid.getnode()).hex[-12:] return "-".join([mac[e:e+2] for e in range(0,11,2)]) |
人生没有原因,闯出一路精彩
1 2 3 4 |
def get_mac_address(self): import uuid mac = uuid.UUID(int = uuid.getnode()).hex[-12:] return "-".join([mac[e:e+2] for e in range(0,11,2)]) |