对于包含数据的二进制数据文件,在struct unpack commannd中选择什么格式:b'@T\x89\x00\x00\x00\x00\x00\x80$\xcds?&x27;

对于包含数据的二进制数据文件,在struct unpack commannd中选择什么格式:b'@T\x89\x00\x00\x00\x00\x00\x80$\xcds?&x27;,struct,binaryfiles,unpack,Struct,Binaryfiles,Unpack,您好,我正在尝试使用struct unpack对某些数据进行解码,但无法选择格式,因为数据类似于b'@T\x89\x00\x00\x00\x80$\xcds?'。有人能帮忙吗?我尝试了不同的数据类型,但没有一个能正确解码 从结构导入* file=open(ch8.bin,'rb') file.close()我只是解决了这个问题,因为我的数据文件有初始数据作为转换器,它对我来说是垃圾数据,所以我读取了这个垃圾数据,在下一个变量中,我读取了对我使用, junk=np.fromfile(file,dt

您好,我正在尝试使用struct unpack对某些数据进行解码,但无法选择格式,因为数据类似于b'@T\x89\x00\x00\x00\x80$\xcds?'。有人能帮忙吗?我尝试了不同的数据类型,但没有一个能正确解码

从结构导入*

file=open(ch8.bin,'rb')


file.close()

我只是解决了这个问题,因为我的数据文件有初始数据作为转换器,它对我来说是垃圾数据,所以我读取了这个垃圾数据,在下一个变量中,我读取了对我使用, junk=np.fromfile(file,dtype=“float32”,count=1)
data=np.fromfile(文件,dtype='float64',sep=”“,offset=0) 谢谢

a=[]
while byte:
enter code here
byte = file.read(8)
values = unpack('f', byte)
a.append(values)