摘要: struct模块提供将二进制数据转换为结构化数据或相反的功能,它定义了以下函数和异常:exception struct.errorstruct.pack(fmt, v1, v2, …) 返回一个string,string由v1,v2…经过给出的格式fmt组成,参数的个数有和类型要和给出的格式一一对应struct.pack_into(fmt, buffer, offset, v1, v2, …) 按照格式fmt将v1, v2 …打包,并从buffer的偏移量offset开始写进buffer中struct.unpack(fmt, string) 以给定的格式fmt来将string解包,结果是个元组 阅读全文
posted @ 2011-03-01 14:34 MXi4oyu 阅读(232) 评论(0) 推荐(0) 编辑