python struct的使用例子

mac2022-06-30  25

import struct i = 1024 # s0为一个字符串,长度为4,即占四个字节,这样方便传输与保存二进制数据。 s0 = struct.pack(">I", i) print(s0) i2 = struct.unpack(">I",s0) print(i2)

转载于:https://www.cnblogs.com/c-x-a/p/11022520.html

相关资源:JAVA上百实例源码以及开源项目
最新回复(0)