Large Array Handling

Martin v. Löwis martin at v.loewis.de
Fri Dec 13 06:57:35 EST 2002


> I am fairly new to python and was wondering about its possibilities. I
want
> to make a boxing management game, and on starting the game i need to
> populate the list of boxers. I was wondering how python will handle a
large
> array of length 1000 * 20. In a fight situation, I will need the
array's
> data for two fighters so rather than make the whole list global I
should
> make a new array just holding the two fighters stats and pass that
correct?
> Or will python be ok handling this size of information?

It all depends on the memory you have. An array of 20*1000 elements,
organized as a list of lists, will take 80KB memory for the array alone;
the really memory consumption probably comes from the elements in the
list. Python itself won't have any problems processing that much data in
memory, provided your computer has enough memory.

Regards,
Martin




More information about the Python-list mailing list