我已经创建了一个整数数组,我希望通过我创建的结构定义来解释它们from array import array
with open('myfile.bin', 'rb') as binaryFile: rest.fromstring(binaryFile.read())
# Now create anothe
在python中创建包含整数/浮点数(非常简单的数据类型)的类似列表的对象的最快方法是什么?他们没有解决我的问题,因为他们的所有解决方案都太慢了:在我的PC上,array.array('i',(0,)*10 ** 8)导致了一个错误(lol);[0 for _ in range它除了速度快外,还有一些缺点:
由于它使用了c