in reply to question of pack.
As above,we can't get the answer you want unless we set correct digits.print (unpack('B8',pack('H2','ff'))) #11111111 print (unpack('B8',pack('i','120'))) #01111000 print (unpack('H2',pack('i','15'))) #0f print (unpack('H',pack('i','15'))) #0
|
|---|