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])亲自试一试 »定义和用法
memoryview() 函数从指定对象返回内存视图对象。
语法
memoryview(obj)
参数值
| 参数 | 描述 |
|---|---|
| obj | 字节对象或字节数组对象。 |
