【发布时间】:2021-05-22 18:42:42
【问题描述】:
我在 python 中使用ctypes 库创建了一个数组。我想知道数组的大小(以字节为单位)。我试过sys.getsizeof()。无论我创建多大的数组,这个函数总是返回 120。
E = (10 * ctypes.py_object)()
for j in range(10):
E[j] = 0
print(sys.getsizeof(E))
output: 120
【问题讨论】:
标签: python python-3.x ctypes