I have data structure defined as follows:
class Factory_Params_Get_Command(Structure):
_pack_ = 1
_fields_ = [("SN",c_byte * 32),
("Voltage",c_byte),
("Reserved",c_byte * 30)]
# Print the fields
def __str__(self):
return "Serial Number: %s" % (list(self.SN))
This prints the serial number like:
[0, 32, 58, 73.....]
I would like to print the serial number as set of hexadecimal values, where each byte is represented by 2 hex numbers, and , if possible , without commas and without spaces. Something like this:
03C8A0D6.....
Would appreciate your help
hex(number)function?