python获取Mac地址

时间:2020-07-21 15:20:10   收藏:0   阅读:62

 

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)])

if __name__ == __main__:
    tt = get_mac_address()
    print(tt)

 

原文:https://www.cnblogs.com/xdd1997/p/13354500.html

评论(0
© 2014 bubuko.com 版权所有 - 联系我们:wmxa8@hotmail.com
打开技术之扣,分享程序人生!