string - Parsing a MAC address with python -


how can convert hex value "0000.0012.13a4" "00:00:00:12:13:a4"?

text = '0000.0012.13a4' text = text.replace('.', '').upper()   # little pre-processing  # chunk groups of 2 , re-join out = ':'.join([text[i : + 2] in range(0, len(text), 2)])    print(out) 

00:00:00:12:13:a4 

Comments

Popular posts from this blog

resizing Telegram inline keyboard -

command line - How can a Python program background itself? -

php - "cURL error 28: Resolving timed out" on Wordpress on Azure App Service on Linux -