参考地址:https://blog.csdn.net/xiangxianghehe/article/details/78172420
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)
转载仅为学习,不会商用。 欢迎转载原创,附文链接。