tobytes()
Return the data in the buffer as a bytestring. This is equivalent to calling the bytes
constructor on the memoryview.
>>> m = memoryview(b"abc") >>> m.tobytes() b'abc' >>> bytes(m) b'abc'
For non-contiguous arrays the result is equal to the flattened list representation with all elements converted to bytes. tobytes()
supports all format strings, including those that are not in struct
module syntax.
Please login to continue.