python array 使用创建10万浮点数
from array import array from random floats = array('d',random((for i in range(10**7)) fp = open('floats.bin','wb') floats.tofile(fp) fp.close() floats2 = array('d') fp1 = open('floats.bin','rb') floats2.fromfile(fp1,10**7) fp1.close()