Discuss / Python / 作业

作业

Topic source

月半意

#1 Created at ... [Delete] [Delete and Lock User]
def bmp_info(data):
    a = struct.unpack('<ccIIIIIIHH',data[:30])
    if (a[0]== b'B') & (a[1] == b'M'):
        return {
            'width': a[-4],
            'height': a[-3],
            'color': a[-1]
        }
    else:
        return 'false'

  • 1

Reply