python convert memoryview to string
For Python 2.7 and 3.x you can try this:
a = memoryview(b'mystring')
print(a) # <memory at 0x10cbebb98>
#for string
print(str(a,'utf8')) # 'mystring' as UTF-8
# for bytes
print(bytes(a)) # b'mystring'
A memory
object can be converted to a string using .tobytes()
like so:
a = memoryview(b'mystring')
print(a) # <memory at 0x10cbebb98>
print(a.tobytes()) # 'mystring'