Memory problem

Yi Xing yxing at ucla.edu
Mon Aug 14 18:21:03 EDT 2006


Thanks! I just found that that I have no problem with 
x=[[10.0]*2560*2560]*500, but x=range(1*2560*2560*30) doesn't work.

-Yi
On Aug 14, 2006, at 3:08 PM, Larry Bates wrote:

> Yi Xing wrote:
>> On a related question: how do I initialize a list or an array with a
>> pre-specified number of elements, something like
>> int p[100] in C? I can do append() for 100 times but this looks 
>> silly...
>>
>> Thanks.
>>
>> Yi Xing
>>
> Unlike other languages this is seldom done in Python.  I think you 
> should
> probably be looking at http://numeric.scipy.org/ if you want to have
> "traditional" arrays of floats.
>
> -Larry
> -- 
> http://mail.python.org/mailman/listinfo/python-list
>




More information about the Python-list mailing list