Discuss / Python / 练习

练习

Topic source

松霜杨雪

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

def bmp_info(data): d = struct.unpack('<ccIIIIIIHH', data[:30])

# 'BM'表示Windows位图,'BA'表示OS/2位图
if d[0] == b'B' and ( d[1] == b'M' or d[1] == b'A'):
    return {
        'width': d[6],
        'height': d[7],
        'color': d[9]
    }
else:
    return None

松霜杨雪

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

试markdown

def bmp_info(data):
    d = struct.unpack('<ccIIIIIIHH', data[:30])
    # 'BM'表示Windows位图,'BA'表示OS/2位图
    if d[0] == b'B' and ( d[1] == b'M' or d[1] == b'A'):
        return {
            'width': d[6],
            'height': d[7],
            'color': d[9]
        }
    else:
        return None

guogebird

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

求助大神,怎么用markdown?


  • 1

Reply