python struct pack解析_python struct.pack() 二进制文件,文件中打包二进制数据的存储与解析...
学习Python的过程中,遇到一个问题,在《Python学习手册》(也就是《learningpython》)中,元组、文件及其他章节里,关于处理二进制文件里,有这么一段代码的处理:>>>F=open('data.bin','wb')>>>importstruct>>>data=struct.pack('i4sh',7,'spam',8)>>>datab'\x00\x00\x00\x07spam\x