I would like to convert
the hex value
a = 0x32
to a string d = 32
Bascially I have a numpy array
msg = np.array[2, 50]
I need to convert both values to hex --- [0x02 , 0x32]
then print the hex values as strings on GUI as 2, 32
I would like to convert
the hex value
a = 0x32
to a string d = 32
Bascially I have a numpy array
msg = np.array[2, 50]
I need to convert both values to hex --- [0x02 , 0x32]
then print the hex values as strings on GUI as 2, 32
hex()
will give you hex string. Then discard first 2 characters
>>> hex(a)
'0x32'
>>> hex(a)[2:]
'32'
>>>
Looking at the link to duplicate, it seems numpy is giving you the L at the end since you are running 64bit linux. so do this:
hex(a)[2:-1]