Python memoryview() လုပ်ဆောင်ချက်
ဥပမာ
memoryview object တစ်ခုကို ဖန်တီးပြီး ပရင့်ထုတ်ပါ-
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. |