Discuss / Python / re永远滴神,能re则re

re永远滴神,能re则re

Topic source

bzny虫

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

import re

def bmp_info(data):

    if re.match(rb'^BM',data):

        print("It's a bitmap\n'")

        datahead=data[0:30]

        dhtext=struct.unpack('<ccIIIIIIHH',datahead)

        return {

            'width': dhtext[6],

            'height': dhtext[7],

            'color': dhtext[9]

        }


  • 1

Reply