I am trying to convert a mac address in hex like this: 00453645f200
to a Mac address in bytes like this:
x00\x45\x36\x45\xf2\x00
But if I use binascii.unhexlify, the result is like this:
b'\x00E6E\xf2\x00'. How can I get the result I want?
I am trying to convert a mac address in hex like this: 00453645f200
to a Mac address in bytes like this:
x00\x45\x36\x45\xf2\x00
But if I use binascii.unhexlify, the result is like this:
b'\x00E6E\xf2\x00'. How can I get the result I want?
Copyright © 2021 Jogjafile Inc.
You can't. The python interpreter will re-format the byte string
b'x00\x45\x36\x45\xf2\x00'tob'\x00E6E\xf2\x00'automatically:You can however, print the hexadecimal representation of each byte via: