Python 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])
التعريف والاستخدام
تقوم memoryview()
الوظيفة بإرجاع كائن عرض الذاكرة من كائن محدد.
بناء الجملة
memoryview(obj)
قيمه المعامل
Parameter | Description |
---|---|
obj | A Bytes object or a Bytearray object. |