I am looking for a more elegant solution to formatting a MAC address with colons. I am using Python 3.2. A fancy list comprehension perhaps?
s=\"\" h=\"0023
Not sure how pretty this is, but it will do what you ask:
':'.join([h[i:i+2] for i,j in enumerate(h) if not (i%2)])
gives:
'00:23:3a:99:0c:21'