<div dir="ltr"><pre class="" style="font-size:0.9em;font-family:'liberation mono','bitstream vera mono','dejavu mono',monospace;color:rgb(51,51,51);overflow:auto;padding:0.5em 1em;margin:0em;line-height:18px;background-color:rgb(237,231,200)">import random
#</pre><pre class="" style="font-size:0.9em;font-family:'liberation mono','bitstream vera mono','dejavu mono',monospace;color:rgb(51,51,51);overflow:auto;padding:0.5em 1em;margin:0em;line-height:18px;background-color:rgb(237,231,200)"><br></pre><pre class="" style="font-size:0.9em;font-family:'liberation mono','bitstream vera mono','dejavu mono',monospace;color:rgb(51,51,51);overflow:auto;padding:0.5em 1em;margin:0em;line-height:18px;background-color:rgb(237,231,200)">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()</pre><pre class="" style="font-size:0.9em;font-family:'liberation mono','bitstream vera mono','dejavu mono',monospace;color:rgb(51,51,51);overflow:auto;padding:0.5em 1em;margin:0em;line-height:18px;background-color:rgb(237,231,200)">for x in range(1,11):</pre><pre class="" style="font-size:0.9em;font-family:'liberation mono','bitstream vera mono','dejavu mono',monospace;color:rgb(51,51,51);overflow:auto;padding:0.5em 1em;margin:0em;line-height:18px;background-color:rgb(237,231,200)">     mac1 = randomMAC()</pre><pre class="" style="font-size:0.9em;font-family:'liberation mono','bitstream vera mono','dejavu mono',monospace;color:rgb(51,51,51);overflow:auto;padding:0.5em 1em;margin:0em;line-height:18px;background-color:rgb(237,231,200)">     print mac1</pre><pre class="" style="font-size:0.9em;font-family:'liberation mono','bitstream vera mono','dejavu mono',monospace;color:rgb(51,51,51);overflow:auto;padding:0.5em 1em;margin:0em;line-height:18px;background-color:rgb(237,231,200)">I got the following random mac generator script from the net (simple google search) </pre><pre class="" style="font-size:0.9em;font-family:'liberation mono','bitstream vera mono','dejavu mono',monospace;color:rgb(51,51,51);overflow:auto;padding:0.5em 1em;margin:0em;line-height:18px;background-color:rgb(237,231,200)">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.</pre><pre class="" style="font-size:0.9em;font-family:'liberation mono','bitstream vera mono','dejavu mono',monospace;color:rgb(51,51,51);overflow:auto;padding:0.5em 1em;margin:0em;line-height:18px;background-color:rgb(237,231,200)"><br></pre></div>