I'm sorry but semi-complicated array operations like this one are still awkward for me in Python.
I have an array in Python that I created with [0xff]*1024
and now I want to set subsequences of that to data ive calculated so lets say I've calculated [0x01,0x02,0x03,0x04]
and want to place that within the first array at a particular position, say 10 bytes in.
So now my array should look like this:
[0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x01,0x02,0x03,0x04,0xff,0xff, ... ]
I still want the array to be 1024 bytes long. I need to insert several of these subsequences. So far I have:
a = [0xff]*1024
b = [0x01,0x02,0x03,0x04]
I'm not sure how to merge the two together. none of append
, insert
or extend
are what I am looking for. b
can be of arbitrary length.