相关疑难解决方法(0)

如何在python中字节交换32位整数?

举个例子:

i = 0x12345678
print("{:08x}".format(i))
   # shows 12345678
i = swap32(i)
print("{:08x}".format(i))
   # should print 78563412
Run Code Online (Sandbox Code Playgroud)

会是什么swap32-function()?有没有办法int在python中进行字节交换,理想情况下使用内置工具?

python integer endianness

19
推荐指数
3
解决办法
3万
查看次数

标签 统计

endianness ×1

integer ×1

python ×1