Discuss / Python / HomeWork

HomeWork

Topic source
def check_bmp(filename):
    with open(filename,"rb") as f:
        t = struct.unpack('<ccIIIIIIHH',s)
        if (t[0] == b'B' and t[1] == b'M'):
            print("Size:",t[2],",Colors:",t[-1])
check_bmp("C://Users//lxw//Desktop//test.bmp")

  • 1

Reply