python3获取本地MAC地址

import uuid

def get_mac_address(): 
    mac=uuid.UUID(int = uuid.getnode()).hex[-12:] 
    return ":".join([mac[e:e+2] for e in range(0,11,2)])

 

posted @ 2017-06-26 14:04  Zen_Garden  阅读(1695)  评论(0编辑  收藏  举报