I'm trying to send some bytes from Python. I'm using struct.pack
to get the corresponding sending bytes. For example:
>>> struct.pack('BBBBBh', 200, 0, 56, 6, 0, 6)
'xc8x008x06x00x00x06x00'
If you take a close look, you can see that the second byte (that sould be x00
) has been merged with the next byte (that should be x38
).
In fact, if I try to concatenate by text:
>>> 'x00' + 'x38'
'x008'
The same thing happens.
I need to have 'x00x38'
. Is this possible? Am I missing something related to formats or whatsoever?
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…