def fun(name): gbk = name.encode('GBK') print(gbk) L =list(gbk) offset = 94*(L[0]-0xa0 -1) + L[1]-0xa0-1 offset = offset*32 print('offset is :%d' % offset) f=open('HZK16','rb') f.seek(offset) display=f.read(32) display = list(display) comp = [0x80,0x40,0x20,0x10,0x08,0x04,0x02,0x01]#分别为只有第8位为1(10000