struct.unpack will unpack data into a tuple. Is there an equivalent that will store data into a dict instead?
In my particular problem, I am dealing with a fixed-width binary format. I want to be able, in one fell swoop, to unpack and store the values in a dict (currently I manually walk through the list and assign dict values)
dict
constructor can take a list or iterator of (name, value) pairs to initialize with. That might help you.namedtuple
if you don't need to modify the object after creating it.