Función Python memoryview()
Ejemplo
Cree e imprima un objeto de vista de memoria:
x = memoryview(b"Hello")
print(x)
#return the Unicode of the
first character
print(x[0])
#return the Unicode of the second
character
print(x[1])
Definición y uso
La memoryview()
función devuelve un objeto de vista de memoria de un objeto especificado.
Sintaxis
memoryview(obj)
Valores paramétricos
Parameter | Description |
---|---|
obj | A Bytes object or a Bytearray object. |