hexrec.records.load_blocks#

hexrec.records.load_blocks(path, record_type=None)[source]#

Loads blocks from a record file.

Parameters:
  • path (str) – Path of the input file.

  • record_type (type) – Explicit record type. If None, it is guessed from the file extension.

Returns:

list of blocks – Blocks loaded from path.

Example

>>> blocks = [[n, bytes(range(n, n + 16))] for n in range(0, 256, 16)]
>>> save_blocks('bytes.mot', blocks)
>>> load_blocks('bytes.mot') == blocks
True