When reading back a fixed size array data encounters a zero byte padded space of the required size, it will not create the extra empty entries in the array. If your data set is bigger than the ...
hex_data = ', '.join(f'0x{byte:02x}' for byte in data) with open(file_name, 'rb') as bin_file, open(source_path, 'w') as source_file: source_file.write(f"// This is ...