pyall.py 文件源码

python
阅读 26 收藏 0 点赞 0 评论 0

项目:pyall 作者: pktrigg 项目源码 文件源码
def read(self):
        self.fileptr.seek(self.offset, 0)
        rec_fmt = '=LBBHLLHHlBBH'
        rec_len = struct.calcsize(rec_fmt)
        rec_unpack = struct.Struct(rec_fmt).unpack_from
        s = rec_unpack(self.fileptr.read(rec_len))

        self.STX             = s[1]
        self.typeOfDatagram  = chr(s[2])
        self.EMModel         = s[3]
        self.RecordDate      = s[4]
        self.Time            = float(s[5]/1000.0)
        self.Counter         = s[6]
        self.SerialNumber    = s[7]
        self.Height          = float (s[8] / float (100))
        self.HeightType      = s[9]

        # now read the footer
        self.ETX, self.checksum = readFooter(self.numberOfBytes, self.fileptr)

###############################################################################
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号