Python memoryview() Funksie
Voorbeeld
Skep en druk 'n geheueaansig-objek:
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])
Definisie en gebruik
Die memoryview()
funksie gee 'n geheue-aansig-objek van 'n gespesifiseerde voorwerp terug.
Sintaksis
memoryview(obj)
Parameterwaardes
Parameter | Description |
---|---|
obj | A Bytes object or a Bytearray object. |