Mar-01-2022, 08:07 PM
bytes is immutable. That is why data doesn't change when you made it: data = bytes([0]*1024). It is like passing a string and expecting the c function to modify the python string.
bytearray is a mutable sequence. You could try data = bytearray([0]*1024).
bytearray is a mutable sequence. You could try data = bytearray([0]*1024).