Apr-14-2020, 08:40 AM
Hi everyone!
I want to make an array of bytes like this: my_array= b'\x01\x00\x00\x01\xff\xff'
Then substitute the 4th element to b'\x50'
if I have a int variable A=50 how I can do to change the 4th element to A
I have tried A=A.to_bytes() and then myarray[3]=A but it didnt work.
any ideas of how to do this?
thank you.
I want to make an array of bytes like this: my_array= b'\x01\x00\x00\x01\xff\xff'
Then substitute the 4th element to b'\x50'
if I have a int variable A=50 how I can do to change the 4th element to A
I have tried A=A.to_bytes() and then myarray[3]=A but it didnt work.
any ideas of how to do this?
thank you.