Discuss / Python / struct作业

struct作业

Topic source

def bmp_info(data):

    a=struct.unpack('<ccIIIIIIHH',data[0:30])

    if a[0:2]==(b'B',b'M') or (b'B',b'A'):

       print('true')

    return {

        'width': a[-4],

        'height': a[-3],

        'color': a[-1]

    }


  • 1

Reply