包头48bit 数据98464 。。。如此循环:
piece_size = 48 piece_size1 = 98464 with open("C:\Users\Administrator\Desktop\bins\234.bin", "rb") as in_file, open("C:\Users\Administrator\Desktop\bins\234_deal.bin", "ab+") as out_file: while True: piece = in_file.read(piece_size) piece1= in_file.read(piece_size1) if not piece: break if not piece1: break out_file.write(piece1) in_file.close() out_file.close() # f = open("C:\Users\Administrator\Desktop\bins\OUT4.TXT", 'rb') # while True: # block = f.read(1024) # print(block) # if not block: # break # f.close()