Memory problem

John Machin sjmachin at lexicon.net
Mon Aug 14 18:26:08 EDT 2006


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

In the case of an array, you may wish to consider the fromfile()
method.

Cheers,
John




More information about the Python-list mailing list