In Python (3) at least, if a binary value has an ASCII representation, it is shown instead of the hexadecimal value. For instance, the binary value of 67 which is ASCII C is show as follows:
bytes([67]) # b'C'
Whereas for binary values without ASCII representations, they are shown in hex. I.E.
b'\x0f'
Is there a way to force Python to show the binary values in their binary-hex form (if this is what it is called), even when there are ASCII representations?
Edit: By this I mean, something that starts with b'\x',. This would make debugging easier when you are looking for specific bytes to be printed for instance.
Thanks
.encode('hex')as that answer mentions does not format the characters the same (i.e. prefixing them with\x\x, you should probably edit your question to say that (and to explain why).'7919'vsb'\x79\x19'