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
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…