Python memoryview() Funzione
Esempio
Crea e stampa un oggetto 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])
Definizione e utilizzo
La memoryview()
funzione restituisce un oggetto di visualizzazione della memoria da un oggetto specificato.
Sintassi
memoryview(obj)
Valori dei parametri
Parameter | Description |
---|---|
obj | A Bytes object or a Bytearray object. |