Large Array Handling

Richard Pasco richardpasco at quintessa.org
Fri Dec 13 11:40:41 EST 2002


"Martin v. Löwis" <martin at v.loewis.de> wrote in message
news:atchvb$7f6$00$1 at news.t-online.com...
> > 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
>
Cheers people, thanks a lot. One last thing - what about global variables?
How many are going to cause a problem? Btw the game is basically aimed at
anyone with a recently up to date computer i.e. 300Mhz, 64Mb RAM min etc





More information about the Python-list mailing list