Saturday, March 30, 2019

Python Mac Format

I''m going to show how to used python script to format the string into mac format



#This support both python2 and python3
s=""
h="00233a990c21"
':'.join(h[i:i+2] for i in range(0,12,2))
print ('mac:'+h)
print ('mac format:'+':'.join(h[i:i+2] for i in range(0,12,2)))










No comments:

Post a Comment