Discuss / Python / 练习

练习

Topic source

Meng。

#1 Created at ... [Delete] [Delete and Lock User]

def bmp_info(data):

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

    if data_1[:2] == (b'B', b'M'):

        return{

            'width': data_1[-4],

            'height': data_1[-3],

            'color': data_1[-1]

        }

    else:

        print('不是位图文件。')

强,学到了


  • 1

Reply