展开全部
首先声明,我本人62616964757a686964616fe4b893e5b19e31333436323164还没有研究出来问题的究竟。此处只是写下我本人的一点小心得,大家一起进步。
因为我发现,使用uuid库得到的mac地址,总有最后一位不对。所以,我就查看了python官方的uuid文档,找到了问题的关键是调用UUID()的时候,会调用getnode()函数以得到物理地址。
这个是getnode()函数的定义:
我把它摘出来,考到下面。
def getnode(*, getters=None):
"""Get the hardware address as a 48-bit positive integer.
The first time this runs, it may launch a separate program, which could
be quite slow. If all attempts to obtain the hardware address fail, we
choose a random 48-bit number with its eighth bit set to 1 as recommended
in RFC 4122.
"""
global _node
if _node is not None:
retu