You can't write into your memoryview, because your memoryview is a view of a bytes object, which is immutable.
If you had a writable memoryview, such as memoryview(bytearray(b'hello'))
, you could do
your_memoryview[:] = whatever
to write the contents of whatever
into the underlying memory.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…