Random MAC generator error

Robert Clove cloverobert at gmail.com
Sat Sep 12 15:20:24 EDT 2015


import random
#


global mac1
def randomMAC():
	mac = [ 0x00, 0x16, 0x3e,
		random.randint(0x00, 0x7f),
		random.randint(0x00, 0xff),
		random.randint(0x00, 0xff) ]
	return ':'.join(map(lambda x: "%02x" % x, mac))
#
print randomMAC()

for x in range(1,11):

     mac1 = randomMAC()

     print mac1

I got the following random mac generator script from the net (simple
google search)

i want to use random mac in one of mine script.What i need is
mac1=randomMAC() should give mac value to mac1 that i use in a
function and this runs in a loop.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20150913/57f5d313/attachment.html>


More information about the Python-list mailing list