Python/ref func memoryview
来自菜鸟教程
<languages />
Python memoryview()函数
例
创建并打印一个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])
定义和用法
The
memoryview()
函数从指定对象返回内存视图对象。
句法
memoryview(obj)
参数值
| 参数 | 描述 |
|---|---|
| obj | 字节对象或字节数组对象。 |