I'm trying to print my hex out in another way...
First I'm converting this (bytestring is the name of the variable):
b'\xff\x00\xff\xff\xff'
to hex,
print(bytestring.hex())
which outputs:
ff00ffffff
but I've been trying for a while to get it to output this:
ff 00 ff ff ff
but no luck.
Any suggestions? Cheers!
Update:
stringdata = f.read(5)
print(stringdata)
#b'\xff\x00\xff\xff\xff'
readHex = " ".join(["{:02x}".format(x) for x in stringdata.hex()])
# ValueError: Unknown format code 'x' for object of type 'str'