python 根据uuid获取mac地址

import uuid


def get_mac_address():
    node = uuid.getnode()
    mac = uuid.UUID(int=node).hex[-12:]
    print(mac)
    return mac


get_mac_address()

 

posted @ 2020-07-06 15:47  市丸银  阅读(833)  评论(0编辑  收藏  举报