Função memoryview() do Python
Exemplo
Crie e imprima um objeto memoryview:
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])
Definição e uso
A memoryview()
função retorna um objeto de exibição de memória de um objeto especificado.
Sintaxe
memoryview(obj)
Valores de parâmetro
Parameter | Description |
---|---|
obj | A Bytes object or a Bytearray object. |