import random
def random_MAC():
random_mac=[11,22,33,random.randint(0x00,0xff),random.randint(0x00,0xff),random.randint(0x00,0xff)]
temp=':'.join(map(lambda x: "%02x" % x,random_mac))
message_to_write=temp+', '+',dctest'+'\n'
return message_to_write
def main():
fileobj=open('mac_test.csv','w')
for i in range(100):
fileobj.write(random_MAC())
fileobj.close()
main()
推荐一款MAC地址生成器 在线MAC地址批量生成工具 - 我查139查询网