0
我讀從文件 四個字節,我想加入他們的行列如何加入的十六進制值
g = f.read(60)
f.seek (60)
k60 =f.read(1)
print('byte60',k60)
k61 =f.read(1)
print('byte61',k61)
k62 =f.read(1)
print('byte62',k62)
k63 =f.read(1)
print('byte63',k63)
print(k63,k62,k61,k60)
print (b''.join([k63,k62,k61,k60]))
的結果是:
b'\x00\x00\x00\x80'
我希望收到:
00000080
[按位操作和用法]的可能重複(http://stackoverflow.com/questions/1746613/bitwise-operation-and-usage) – Plouff
不,它不是,我不想總結他們,但他們旁邊其他沒有「\ x」 –
給我們你的輸入文件和'print('byte6x',k6x)'的結果。 – Plouff