Python memoryview() Fungsi
Contoh
Membuat dan mencetak objek 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])
Definisi dan Penggunaan
Fungsi memoryview()
mengembalikan objek tampilan memori dari objek tertentu.
Sintaksis
memoryview(obj)
Nilai Parameter
Parameter | Description |
---|---|
obj | A Bytes object or a Bytearray object. |